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
Kirill Smelkov
cython
Commits
20787f28
Commit
20787f28
authored
Dec 28, 2019
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.29.x'
parents
14fd58bb
ada8dbd8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
18 deletions
+55
-18
CHANGES.rst
CHANGES.rst
+10
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+12
-13
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+14
-4
tests/run/py3k_super.pyx
tests/run/py3k_super.pyx
+19
-1
No files found.
CHANGES.rst
View file @
20787f28
...
...
@@ -166,6 +166,16 @@ Other changes
*
Support
for
Python
2.6
was
removed
.
0.29.15
(
20
??-??-??)
====================
*
Double
reference
free
in
``
__class__
``
cell
handling
for
``
super
()``
calls
.
(
Github
issue
#
3246
)
*
Deprecated
import
failed
in
Python
3.9
.
(
Github
issue
#
3266
)
0.29.14
(
2019
-
11
-
01
)
====================
...
...
Cython/Compiler/ExprNodes.py
View file @
20787f28
...
...
@@ -9103,21 +9103,20 @@ class ClassCellInjectorNode(ExprNode):
def
analyse_expressions
(
self
,
env
):
return
self
def
generate_evaluation_code
(
self
,
code
):
if
self
.
is_active
:
self
.
allocate_temp_result
(
code
)
code
.
putln
(
'%s = PyList_New(0); %s'
%
(
self
.
result
(),
code
.
error_goto_if_null
(
self
.
result
(),
self
.
pos
)))
code
.
put_gotref
(
self
.
result
())
def
generate_result_code
(
self
,
code
):
assert
self
.
is_active
code
.
putln
(
'%s = PyList_New(0); %s'
%
(
self
.
result
(),
code
.
error_goto_if_null
(
self
.
result
(),
self
.
pos
)))
code
.
put_gotref
(
self
.
result
())
def
generate_injection_code
(
self
,
code
,
classobj_cname
):
if
self
.
is_active
:
code
.
globalstate
.
use_utility_code
(
UtilityCode
.
load_cached
(
"CyFunctionClassCell"
,
"CythonFunction.c"
))
code
.
put_error_if_neg
(
self
.
pos
,
'__Pyx_CyFunction_InitClassCell(%s, %s)'
%
(
self
.
result
(),
classobj_cname
))
assert
self
.
is_active
code
.
globalstate
.
use_utility_code
(
UtilityCode
.
load_cached
(
"CyFunctionClassCell"
,
"CythonFunction.c"
))
code
.
put_error_if_neg
(
self
.
pos
,
'__Pyx_CyFunction_InitClassCell(%s, %s)'
%
(
self
.
result
(),
classobj_cname
))
class
ClassCellNode
(
ExprNode
):
...
...
Cython/Compiler/Nodes.py
View file @
20787f28
...
...
@@ -4818,12 +4818,22 @@ class PyClassDefNode(ClassDefNode):
self
.
metaclass
.
generate_evaluation_code
(
code
)
self
.
dict
.
generate_evaluation_code
(
code
)
cenv
.
namespace_cname
=
cenv
.
class_obj_cname
=
self
.
dict
.
result
()
self
.
class_cell
.
generate_evaluation_code
(
code
)
class_cell
=
self
.
class_cell
if
class_cell
is
not
None
and
not
class_cell
.
is_active
:
class_cell
=
None
if
class_cell
is
not
None
:
class_cell
.
generate_evaluation_code
(
code
)
self
.
body
.
generate_execution_code
(
code
)
self
.
class_result
.
generate_evaluation_code
(
code
)
self
.
class_cell
.
generate_injection_code
(
code
,
self
.
class_result
.
result
())
self
.
class_cell
.
generate_disposal_code
(
code
)
if
class_cell
is
not
None
:
class_cell
.
generate_injection_code
(
code
,
self
.
class_result
.
result
())
if
class_cell
is
not
None
:
class_cell
.
generate_disposal_code
(
code
)
class_cell
.
free_temps
(
code
)
cenv
.
namespace_cname
=
cenv
.
class_obj_cname
=
self
.
classobj
.
result
()
self
.
target
.
generate_assignment_code
(
self
.
class_result
,
code
)
self
.
dict
.
generate_disposal_code
(
code
)
...
...
tests/run/py3k_super.pyx
View file @
20787f28
# mode: run
# tag: py3k_super
# tag: py3k_super
, gh3246
class
A
(
object
):
def
method
(
self
):
...
...
@@ -89,3 +89,21 @@ cdef class CClassSub(CClassBase):
# return super().method_cp()
# cdef method_c(self):
# return super().method_c()
def
freeing_class_cell_temp_gh3246
():
# https://github.com/cython/cython/issues/3246
"""
>>> abc = freeing_class_cell_temp_gh3246()
>>> abc().a
1
"""
class
SimpleBase
(
object
):
def
__init__
(
self
):
self
.
a
=
1
class
ABC
(
SimpleBase
):
def
__init__
(
self
):
super
().
__init__
()
return
ABC
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