Commit 46d38ea8 authored by Stefan Behnel's avatar Stefan Behnel

recognise when 'classmethod' gets overridden

parent 699d2353
...@@ -1184,6 +1184,9 @@ class ClassScope(Scope): ...@@ -1184,6 +1184,9 @@ class ClassScope(Scope):
return self.outer_scope.add_string_const(value, identifier) return self.outer_scope.add_string_const(value, identifier)
def lookup(self, name): def lookup(self, name):
entry = Scope.lookup(self, name)
if entry:
return entry
if name == "classmethod": if name == "classmethod":
# We don't want to use the builtin classmethod here 'cause it won't do the # 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). # right thing in this scope (as the class memebers aren't still functions).
...@@ -1197,9 +1200,7 @@ class ClassScope(Scope): ...@@ -1197,9 +1200,7 @@ class ClassScope(Scope):
py_object_type, py_object_type,
[PyrexTypes.CFuncTypeArg("", py_object_type, None)], 0, 0)) [PyrexTypes.CFuncTypeArg("", py_object_type, None)], 0, 0))
entry.is_cfunction = 1 entry.is_cfunction = 1
return entry return entry
else:
return Scope.lookup(self, name)
class PyClassScope(ClassScope): class PyClassScope(ClassScope):
......
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