Commit 64695280 authored by Stefan Behnel's avatar Stefan Behnel

Minor code cleanup.

parent c0ceabe1
...@@ -2885,13 +2885,16 @@ class DefNode(FuncDefNode): ...@@ -2885,13 +2885,16 @@ class DefNode(FuncDefNode):
# staticmethod() was overridden - not much we can do here ... # staticmethod() was overridden - not much we can do here ...
self.is_staticmethod = False self.is_staticmethod = False
if self.name == '__new__' and env.is_py_class_scope: if env.is_py_class_scope:
self.is_staticmethod = True if self.name == '__new__':
if not self.is_classmethod and self.name in IMPLICIT_CLASSMETHODS and env.is_py_class_scope: self.is_staticmethod = True
from .ExprNodes import NameNode elif not self.is_classmethod and self.name in IMPLICIT_CLASSMETHODS:
self.decorators = self.decorators or [] self.is_classmethod = True
self.decorators.insert(0, DecoratorNode(self.pos, decorator=NameNode(self.pos, name=EncodedString('classmethod')))) # TODO: remove the need to generate a real decorator here, is_classmethod=True should suffice.
self.is_classmethod = True from .ExprNodes import NameNode
self.decorators = self.decorators or []
self.decorators.insert(0, DecoratorNode(
self.pos, decorator=NameNode(self.pos, name=EncodedString('classmethod'))))
self.analyse_argument_types(env) self.analyse_argument_types(env)
if self.name == '<lambda>': if self.name == '<lambda>':
......
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