From: Stefan Behnel Date: Thu, 26 Nov 2009 18:09:02 +0000 (+0100) Subject: recognise when 'classmethod' gets overridden X-Git-Tag: 0.12.1~119^2~5 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=46d38ea8c7e046d6eb90b710cf22e9434cb4adf5;p=cython.git recognise when 'classmethod' gets overridden --- diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 5bc9c3c5..42b21fd2 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -1184,6 +1184,9 @@ class ClassScope(Scope): return self.outer_scope.add_string_const(value, identifier) def lookup(self, name): + entry = Scope.lookup(self, name) + if entry: + return entry if name == "classmethod": # We don't want to use the builtin classmethod here 'cause it won't do the # right thing in this scope (as the class memebers aren't still functions). @@ -1197,9 +1200,7 @@ class ClassScope(Scope): py_object_type, [PyrexTypes.CFuncTypeArg("", py_object_type, None)], 0, 0)) entry.is_cfunction = 1 - return entry - else: - return Scope.lookup(self, name) + return entry class PyClassScope(ClassScope):