Commit 2d2ea33c authored by Stefan Behnel's avatar Stefan Behnel

removed lots of unused imports, delayed some imports that are only needed for...

removed lots of unused imports, delayed some imports that are only needed for Cython specific syntax

--HG--
extra : rebase_source : a2df3675fd1efae1a1122ca9742e99ab1405fba6
parent 84307315
from Cython.Compiler.Visitor import CythonTransform
from Cython.Compiler.Nodes import DefNode, CFuncDefNode
from Cython.Compiler.Errors import CompileError
from Cython.Compiler.StringEncoding import EncodedString
from Cython.Compiler import Options
from Cython.Compiler import PyrexTypes, ExprNodes
......
from Visitor import VisitorTransform, CythonTransform
from Visitor import CythonTransform
from ModuleNode import ModuleNode
from Nodes import *
from ExprNodes import *
from StringEncoding import EncodedString
from Errors import CompileError
from UtilityCode import CythonUtilityCode
from Code import UtilityCode, ContentHashingUtilityCode
import Cython.Compiler.Options
from Code import UtilityCode
import Interpreter
import PyrexTypes
import Naming
import Symtab
import textwrap
def dedent(text, reindent=0):
text = textwrap.dedent(text)
from textwrap import dedent
text = dedent(text)
if reindent > 0:
indent = " " * reindent
text = '\n'.join([indent + x for x in text.split('\n')])
......
from Cython.Compiler.Visitor import VisitorTransform, CythonTransform
from Cython.Compiler.ModuleNode import ModuleNode
from Cython.Compiler.Nodes import *
from Cython.Compiler.ExprNodes import *
from Cython.Compiler.Visitor import VisitorTransform
from Cython.Compiler.Nodes import StatListNode
class ExtractPxdCode(VisitorTransform):
"""
......
......@@ -3,8 +3,6 @@ from PyrexTypes import *
from UtilityCode import CythonUtilityCode
from Errors import error
from Scanning import StringSourceDescriptor
import Options
import Buffer
import MemoryView
class CythonScope(ModuleScope):
......
......@@ -8,10 +8,10 @@ cython.declare(PyrexTypes=object, Naming=object, ExprNodes=object, Nodes=object,
import Builtin
import ExprNodes
import Nodes
from PyrexTypes import py_object_type, unspecified_type
from PyrexTypes import py_object_type
from Visitor import TreeVisitor, CythonTransform
from Errors import error, warning, CompileError, InternalError
from Errors import error, warning, InternalError
class TypedExprNode(ExprNodes.ExprNode):
# Used for declaring assignments of a specified type without a known entry.
......
......@@ -6,7 +6,6 @@ For now this only covers parse tree to value conversion of
compile-time values.
"""
import sys
from Nodes import *
from ExprNodes import *
from Errors import CompileError
......
......@@ -7,9 +7,6 @@ if sys.version_info[:2] < (2, 3):
sys.stderr.write("Sorry, Cython requires Python 2.3 or later\n")
sys.exit(1)
import itertools
import Code
import Errors
# Do not import Parsing here, import it when needed, because Parsing imports
# Nodes, which globally needs debug command line options initialized to set a
......@@ -18,11 +15,9 @@ import Errors
# import Parsing
import Version
from Scanning import PyrexScanner, FileSourceDescriptor
from Errors import PyrexError, CompileError, InternalError, AbortError, error, warning
from Errors import PyrexError, CompileError, error, warning
from Symtab import ModuleScope
from Cython import Utils
from Cython.Utils import open_new_file, replace_suffix
import DebugFlags
import Options
module_name_pattern = re.compile(r"[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$")
......
from Errors import CompileError, error
import ExprNodes
from ExprNodes import IntNode, NoneNode, IntBinopNode, NameNode, AttributeNode
from Visitor import CythonTransform
from ExprNodes import IntNode, NameNode, AttributeNode
import Options
from Code import UtilityCode
from UtilityCode import CythonUtilityCode
from PyrexTypes import py_object_type, cython_memoryview_ptr_type
import Buffer
import PyrexTypes
......
......@@ -16,10 +16,8 @@ import Code
import Naming
import Nodes
import Options
import PyrexTypes
import TypeSlots
import Version
import DebugFlags
import PyrexTypes
from Errors import error, warning
......
......@@ -5,12 +5,12 @@
import cython
cython.declare(sys=object, os=object, time=object, copy=object,
Builtin=object, error=object, warning=object, Naming=object, PyrexTypes=object,
py_object_type=object, ModuleScope=object, LocalScope=object, ClosureScope=object, \
py_object_type=object, ModuleScope=object, LocalScope=object, ClosureScope=object,
StructOrUnionScope=object, PyClassScope=object, CClassScope=object,
CppClassScope=object, UtilityCode=object, EncodedString=object,
absolute_path_length=cython.Py_ssize_t)
import sys, os, time, copy, textwrap
import sys, os, time, copy
import Builtin
from Errors import error, warning, InternalError, CompileError
......
import cython
cython.declare(PyrexTypes=object, Naming=object, ExprNodes=object, Nodes=object,
Options=object, UtilNodes=object, ModuleNode=object,
LetNode=object, LetRefNode=object, TreeFragment=object,
TemplateTransform=object, EncodedString=object,
Options=object, UtilNodes=object, LetNode=object,
LetRefNode=object, TreeFragment=object, EncodedString=object,
error=object, warning=object, copy=object)
import PyrexTypes
......@@ -14,9 +13,8 @@ import Builtin
from Cython.Compiler.Visitor import VisitorTransform, TreeVisitor
from Cython.Compiler.Visitor import CythonTransform, EnvTransform, ScopeTrackingTransform
from Cython.Compiler.ModuleNode import ModuleNode
from Cython.Compiler.UtilNodes import LetNode, LetRefNode, ResultRefNode
from Cython.Compiler.TreeFragment import TreeFragment, TemplateTransform
from Cython.Compiler.TreeFragment import TreeFragment
from Cython.Compiler.StringEncoding import EncodedString
from Cython.Compiler.Errors import error, warning, CompileError, InternalError
......
......@@ -7,9 +7,7 @@
import cython
cython.declare(Nodes=object, ExprNodes=object, EncodedString=object)
import os
import re
import sys
from Cython.Compiler.Scanning import PyrexScanner, FileSourceDescriptor
import Nodes
......@@ -17,7 +15,7 @@ import ExprNodes
import StringEncoding
from StringEncoding import EncodedString, BytesLiteral, _unicode, _bytes
from ModuleNode import ModuleNode
from Errors import error, warning, InternalError
from Errors import error, warning
from Cython import Utils
import Future
import Options
......
......@@ -5,7 +5,7 @@ import Errors
import DebugFlags
import Options
from Visitor import CythonTransform
from Errors import PyrexError, CompileError, InternalError, AbortError, error
from Errors import CompileError, InternalError, AbortError
#
# Really small pipeline stages
......
......@@ -2,8 +2,6 @@
# Cython/Python language types
#
import cython
from Code import UtilityCode, LazyUtilityCode, ContentHashingUtilityCode
import StringEncoding
import Naming
......
......@@ -3,7 +3,6 @@
# Cython Scanner
#
import sys
import os
import platform
......@@ -11,10 +10,10 @@ import cython
cython.declare(EncodedString=object, string_prefixes=object, raw_prefixes=object, IDENT=unicode,
print_function=object)
from Cython import Plex, Utils
from Cython import Utils
from Cython.Plex.Scanners import Scanner
from Cython.Plex.Errors import UnrecognizedInput
from Errors import CompileError, error
from Errors import error
from Lexicon import string_prefixes, raw_prefixes, make_lexicon, IDENT
from Future import print_function
......
......@@ -3,13 +3,11 @@
#
import re
from Cython import Utils
from Errors import warning, error, InternalError
from StringEncoding import EncodedString
import Options, Naming
import PyrexTypes
from PyrexTypes import py_object_type, unspecified_type
import TypeSlots
from TypeSlots import \
pyfunction_signature, pymethod_signature, \
get_special_method_signature, get_property_accessor_signature
......
......@@ -6,7 +6,6 @@ import re
from StringIO import StringIO
from Scanning import PyrexScanner, StringSourceDescriptor
from Symtab import ModuleScope
import Symtab
import PyrexTypes
from Visitor import VisitorTransform
from Nodes import Node, StatListNode
......
from Errors import error, warning, message, warn_once, InternalError
from Errors import error, message
import ExprNodes
import Nodes
import Builtin
......
......@@ -6,7 +6,6 @@
import Naming
import PyrexTypes
import StringEncoding
import sys
invisible = ['__cinit__', '__dealloc__', '__richcmp__',
'__nonzero__', '__bool__']
......
from TreeFragment import parse_from_strings, StringParseContext
from Scanning import StringSourceDescriptor
import Symtab
import Naming
from Cython.Compiler import Visitor
import Code
class NonManglingModuleScope(Symtab.ModuleScope):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment