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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
c6f29a39
Commit
c6f29a39
authored
Sep 01, 2016
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push defaults-getter function into module scope instead of risking to make it a method
parent
3c461473
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+4
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
c6f29a39
...
@@ -8822,8 +8822,10 @@ class PyCFunctionNode(ExprNode, ModuleNameMixin):
...
@@ -8822,8 +8822,10 @@ class PyCFunctionNode(ExprNode, ModuleNameMixin):
self
.
pos
,
args
=
[
defaults_tuple
,
defaults_kwdict
])),
self
.
pos
,
args
=
[
defaults_tuple
,
defaults_kwdict
])),
decorators
=
None
,
decorators
=
None
,
name
=
StringEncoding
.
EncodedString
(
"__defaults__"
))
name
=
StringEncoding
.
EncodedString
(
"__defaults__"
))
defaults_getter
.
analyse_declarations
(
env
)
# defaults getter must never live in class scopes, it's always a module function
defaults_getter
=
defaults_getter
.
analyse_expressions
(
env
)
module_scope
=
env
.
global_scope
()
defaults_getter
.
analyse_declarations
(
module_scope
)
defaults_getter
=
defaults_getter
.
analyse_expressions
(
module_scope
)
defaults_getter
.
body
=
defaults_getter
.
body
.
analyse_expressions
(
defaults_getter
.
body
=
defaults_getter
.
body
.
analyse_expressions
(
defaults_getter
.
local_scope
)
defaults_getter
.
local_scope
)
defaults_getter
.
py_wrapper_required
=
False
defaults_getter
.
py_wrapper_required
=
False
...
...
Cython/Compiler/Nodes.py
View file @
c6f29a39
...
@@ -3068,7 +3068,8 @@ class DefNode(FuncDefNode):
...
@@ -3068,7 +3068,8 @@ class DefNode(FuncDefNode):
def
generate_function_definitions
(
self
,
env
,
code
):
def
generate_function_definitions
(
self
,
env
,
code
):
if
self
.
defaults_getter
:
if
self
.
defaults_getter
:
self
.
defaults_getter
.
generate_function_definitions
(
env
,
code
)
# defaults getter must never live in class scopes, it's always a module function
self
.
defaults_getter
.
generate_function_definitions
(
env
.
global_scope
(),
code
)
# Before closure cnames are mangled
# Before closure cnames are mangled
if
self
.
py_wrapper_required
:
if
self
.
py_wrapper_required
:
...
...
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