From: Robert Bradshaw Date: Tue, 15 Dec 2009 13:03:44 +0000 (-0800) Subject: cleanup relative to 0.12 X-Git-Tag: 0.13.beta0~353^2~29 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=aea632869b14e0239b028a68d03147068327a9f1;p=cython.git cleanup relative to 0.12 --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index f42ab943..ff8e6525 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -4036,6 +4036,7 @@ class UnboundMethodNode(ExprNode): code.error_goto_if_null(self.result(), self.pos))) code.put_gotref(self.py_result()) + class PyCFunctionNode(AtomicExprNode): # Helper class used in the implementation of Python # class definitions. Constructs a PyCFunction object @@ -4127,7 +4128,6 @@ class UnopNode(ExprNode): if self.is_py_operation(): self.gil_error() - def is_cpp_operation(self): return self.operand.type.is_cpp_class @@ -4166,7 +4166,6 @@ class UnopNode(ExprNode): self.type_error() return self.type = function.type.return_type - class NotNode(ExprNode): @@ -4748,7 +4747,6 @@ class NumBinopNode(BinopNode): def py_operation_function(self): return self.py_functions[self.operator] - py_functions = { "|": "PyNumber_Or", @@ -4764,7 +4762,7 @@ class NumBinopNode(BinopNode): "%": "PyNumber_Remainder", "**": "PyNumber_Power" } - + class IntBinopNode(NumBinopNode): # Binary operation taking integer arguments. @@ -5523,7 +5521,6 @@ class PrimaryCmpNode(ExprNode, CmpNode): self.operand2.analyse_types(env) if self.is_cpp_comparison(): self.analyse_cpp_comparison(env) - return if self.cascade: self.cascade.analyse_types(env) @@ -5636,7 +5633,7 @@ class PrimaryCmpNode(ExprNode, CmpNode): self.operand2.annotate(code) if self.cascade: self.cascade.annotate(code) - + class CascadedCmpNode(Node, CmpNode): # A CascadedCmpNode is not a complete expression node. It diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py index 4d35ed3c..2e11ed03 100644 --- a/Cython/Compiler/Main.py +++ b/Cython/Compiler/Main.py @@ -76,7 +76,6 @@ class Context(object): self.compiler_directives = compiler_directives self.cpp = cpp - self.pxds = {} # full name -> node tree standard_include_path = os.path.abspath( diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 8bb096eb..6d13154a 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -342,7 +342,6 @@ class StatListNode(Node): def analyse_expressions(self, env): #print "StatListNode.analyse_expressions" ### - entry = env.entries.get("cpp_sum", None) for stat in self.stats: stat.analyse_expressions(env) diff --git a/Cython/Compiler/Options.py b/Cython/Compiler/Options.py index d265c15d..9fccdf74 100644 --- a/Cython/Compiler/Options.py +++ b/Cython/Compiler/Options.py @@ -6,7 +6,6 @@ cache_builtins = 1 # Perform lookups on builtin names only once embed_pos_in_docstring = 0 gcc_branch_hints = 1 -cplus = 0 pre_import = None docstrings = True diff --git a/Cython/Compiler/Parsing.pxd b/Cython/Compiler/Parsing.pxd index 982088be..c5f19761 100644 --- a/Cython/Compiler/Parsing.pxd +++ b/Cython/Compiler/Parsing.pxd @@ -151,4 +151,3 @@ cpdef p_code(PyrexScanner s, level= *) cpdef p_compiler_directive_comments(PyrexScanner s) cpdef p_module(PyrexScanner s, pxd, full_module_name) cpdef p_cpp_class_definition(PyrexScanner s, ctx) - diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index 871633b5..e858a16b 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -1906,7 +1906,6 @@ def p_buffer_or_template(s, base_type_node): keyword_args = keyword_dict, base_type_node = base_type_node) return result - def looking_at_name(s): diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index b0bd832b..c23c6aee 100755 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -1359,7 +1359,6 @@ class CNullPtrType(CPtrType): is_null_ptr = 1 - class CReferenceType(CType): is_reference = 1 @@ -2271,7 +2270,6 @@ def best_match(args, functions, pos): return None - def widest_numeric_type(type1, type2): # Given two numeric types, return the narrowest type # encompassing both of them. diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 63deaea4..6596c714 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -1483,7 +1483,6 @@ class CClassScope(ClassScope): entry.is_inherited = 1 - class CppClassScope(Scope): # Namespace of a C++ class. inherited_var_entries = [] diff --git a/Cython/Compiler/Tests/TestDecorators.py b/Cython/Compiler/Tests/TestDecorators.py index c8ec01b8..7f494351 100644 --- a/Cython/Compiler/Tests/TestDecorators.py +++ b/Cython/Compiler/Tests/TestDecorators.py @@ -12,6 +12,7 @@ class TestDecorator(TransformTest): def decorated(): pass """) + self.assertCode(u""" def decorator(fun): return fun