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
235a625e
Commit
235a625e
authored
Aug 28, 2019
by
Stefan Behnel
Committed by
GitHub
Aug 28, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Rename self_result_code -> closure_result_code and delete unused self_object (GH-3105)
parents
27d729a1
b31dbe42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
16 deletions
+9
-16
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+8
-15
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+1
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
235a625e
...
...
@@ -9146,7 +9146,6 @@ class PyCFunctionNode(ExprNode, ModuleNameMixin):
# from a PyMethodDef struct.
#
# pymethdef_cname string PyMethodDef structure
# self_object ExprNode or None
# binding bool
# def_node DefNode the Python function node
# module_name EncodedString Name of defining module
...
...
@@ -9155,7 +9154,6 @@ class PyCFunctionNode(ExprNode, ModuleNameMixin):
subexprs
=
[
'code_object'
,
'defaults_tuple'
,
'defaults_kwdict'
,
'annotations_dict'
]
self_object
=
None
code_object
=
None
binding
=
False
def_node
=
None
...
...
@@ -9326,12 +9324,8 @@ class PyCFunctionNode(ExprNode, ModuleNameMixin):
gil_message
=
"Constructing Python function"
def
self_result_code
(
self
):
if
self
.
self_object
is
None
:
self_result
=
"NULL"
else
:
self_result
=
self
.
self_object
.
py_result
()
return
self_result
def
closure_result_code
(
self
):
return
"NULL"
def
generate_result_code
(
self
,
code
):
if
self
.
binding
:
...
...
@@ -9345,7 +9339,7 @@ class PyCFunctionNode(ExprNode, ModuleNameMixin):
'%s = PyCFunction_NewEx(&%s, %s, %s); %s'
%
(
self
.
result
(),
self
.
pymethdef_cname
,
self
.
self
_result_code
(),
self
.
closure
_result_code
(),
py_mod_name
,
code
.
error_goto_if_null
(
self
.
result
(),
self
.
pos
)))
...
...
@@ -9392,7 +9386,7 @@ class PyCFunctionNode(ExprNode, ModuleNameMixin):
self
.
pymethdef_cname
,
flags
,
self
.
get_py_qualified_name
(
code
),
self
.
self
_result_code
(),
self
.
closure
_result_code
(),
self
.
get_py_mod_name
(
code
),
Naming
.
moddict_cname
,
code_object_result
,
...
...
@@ -9438,13 +9432,12 @@ class PyCFunctionNode(ExprNode, ModuleNameMixin):
class
InnerFunctionNode
(
PyCFunctionNode
):
# Special PyCFunctionNode that depends on a closure class
#
binding
=
True
needs_
self
_code
=
True
needs_
closure
_code
=
True
def
self
_result_code
(
self
):
if
self
.
needs_
self
_code
:
def
closure
_result_code
(
self
):
if
self
.
needs_
closure
_code
:
return
"((PyObject*)%s)"
%
Naming
.
cur_scope_cname
return
"NULL"
...
...
@@ -9667,7 +9660,7 @@ class GeneratorExpressionNode(LambdaNode):
'%s = %s(%s); %s'
%
(
self
.
result
(),
self
.
def_node
.
entry
.
pyfunc_cname
,
self
.
self
_result_code
(),
self
.
closure
_result_code
(),
code
.
error_goto_if_null
(
self
.
result
(),
self
.
pos
)))
code
.
put_gotref
(
self
.
py_result
())
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
235a625e
...
...
@@ -2732,7 +2732,7 @@ class CreateClosureClasses(CythonTransform):
if
not
node
.
py_cfunc_node
:
raise
InternalError
(
"DefNode does not have assignment node"
)
inner_node
=
node
.
py_cfunc_node
inner_node
.
needs_
self
_code
=
False
inner_node
.
needs_
closure
_code
=
False
node
.
needs_outer_scope
=
False
if
node
.
is_generator
:
...
...
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