From: Robert Bradshaw Date: Mon, 10 Sep 2007 17:35:20 +0000 (-0700) Subject: enable attribute access of cdef functions X-Git-Tag: 0.9.6.14~29^2~147 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4eb283b6b798a9390ffa19da548ac22d8ed3137d;p=cython.git enable attribute access of cdef functions --- diff --git a/Cython/Compiler/CmdLine.py b/Cython/Compiler/CmdLine.py index 84f9e2be..aefa24fb 100644 --- a/Cython/Compiler/CmdLine.py +++ b/Cython/Compiler/CmdLine.py @@ -22,7 +22,7 @@ Options: -z, --pre-import If specified, assume undeclared names in this module. Emulates the behavior of putting "from import *" at the top of the file. - --incref_local_binop Force local an extra incref on local variables before + --incref-local-binop Force local an extra incref on local variables before performing any binary operations. """ #The following experimental options are supported only on MacOSX: @@ -78,7 +78,7 @@ def parse_command_line(args): Options.embed_pos_in_docstring = 1 elif option in ("-z", "--pre-import"): Options.pre_import = pop_arg() - elif option == "--incref_local_binop": + elif option == "--incref-local-binop": Options.incref_local_binop = 1 else: bad_usage() diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index f4e59964..8e506cfd 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -1626,7 +1626,8 @@ class AttributeNode(ExprNode): self.obj.analyse_types(env) self.analyse_attribute(env) if self.entry and self.entry.is_cmethod and not self.is_called: - error(self.pos, "C method can only be called") +# error(self.pos, "C method can only be called") + pass ## Reference to C array turns into pointer to first element. #while self.type.is_array: # self.type = self.type.element_ptr_type() @@ -2837,7 +2838,7 @@ class CmpNode: and op not in ('is', 'is_not')): return 1 else: - return 0 + return type1.is_cfunction and type1.is_cfunction and type1 == type2 def generate_operation_code(self, code, result_code, operand1, op , operand2): diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 390860cf..c52bede4 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -158,7 +158,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): module_list.append(env) def generate_module_preamble(self, env, cimported_modules, code): - code.putln('/* Generated by Pyrex %s on %s */' % ( + code.putln('/* Generated by Cython %s on %s */' % ( Version.version, time.asctime())) code.putln('') code.putln('#define PY_SSIZE_T_CLEAN') diff --git a/Cython/Compiler/Version.py b/Cython/Compiler/Version.py index 8e4c1ebe..a167c422 100644 --- a/Cython/Compiler/Version.py +++ b/Cython/Compiler/Version.py @@ -1 +1 @@ -version = '0.9.6.5' +version = '0.9.6.6'