Commit 3b931f10 authored by mattip's avatar mattip

whoops, staticmethod is a valid cdef decorator

parent bee7b699
...@@ -2344,11 +2344,10 @@ class CFuncDefNode(FuncDefNode): ...@@ -2344,11 +2344,10 @@ class CFuncDefNode(FuncDefNode):
for decorator in self.decorators: for decorator in self.decorators:
func = decorator.decorator func = decorator.decorator
if func.is_name: if func.is_name:
if func.name == 'classmethod' or func.name == 'staticmethod': if func.name in ('property', 'staticmethod'):
error(self.pos, "Cannot handle these decorators yet")
if func.name == 'property':
# XXX DO SOMETHING HERE???
pass pass
else:
error(self.pos, "Cannot handle %s decorators yet" % func.name)
self.is_c_class_method = env.is_c_class_scope self.is_c_class_method = env.is_c_class_scope
if self.directive_locals is None: if self.directive_locals is None:
......
...@@ -2256,6 +2256,7 @@ class ReplacePropertyNode(CythonTransform): ...@@ -2256,6 +2256,7 @@ class ReplacePropertyNode(CythonTransform):
# done - remove the decorator node # done - remove the decorator node
node.decorators.remove(decorator_node) node.decorators.remove(decorator_node)
return [node] return [node]
return [node]
class FindInvalidUseOfFusedTypes(CythonTransform): class FindInvalidUseOfFusedTypes(CythonTransform):
......
...@@ -150,7 +150,7 @@ def sum(Foo f): ...@@ -150,7 +150,7 @@ def sum(Foo f):
cdef extern from "foo.h": cdef extern from "foo.h":
ctypedef class foo_extension.Foo [object FooStructOpaque]: ctypedef class foo_extension.Foo [object FooStructOpaque]:
@staticmethod @classmethod
cdef void field0(): cdef void field0():
print('in staticmethod of Foo') print('in staticmethod of Foo')
......
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