Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
64695280
Commit
64695280
authored
Apr 20, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor code cleanup.
parent
c0ceabe1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+10
-7
No files found.
Cython/Compiler/Nodes.py
View file @
64695280
...
...
@@ -2885,13 +2885,16 @@ class DefNode(FuncDefNode):
# staticmethod() was overridden - not much we can do here ...
self
.
is_staticmethod
=
False
if
self
.
name
==
'__new__'
and
env
.
is_py_class_scope
:
self
.
is_staticmethod
=
True
if
not
self
.
is_classmethod
and
self
.
name
in
IMPLICIT_CLASSMETHODS
and
env
.
is_py_class_scope
:
from
.ExprNodes
import
NameNode
self
.
decorators
=
self
.
decorators
or
[]
self
.
decorators
.
insert
(
0
,
DecoratorNode
(
self
.
pos
,
decorator
=
NameNode
(
self
.
pos
,
name
=
EncodedString
(
'classmethod'
))))
self
.
is_classmethod
=
True
if
env
.
is_py_class_scope
:
if
self
.
name
==
'__new__'
:
self
.
is_staticmethod
=
True
elif
not
self
.
is_classmethod
and
self
.
name
in
IMPLICIT_CLASSMETHODS
:
self
.
is_classmethod
=
True
# TODO: remove the need to generate a real decorator here, is_classmethod=True should suffice.
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
)
if
self
.
name
==
'<lambda>'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment