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
db1a7dab
Commit
db1a7dab
authored
3 years ago
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.29.x'
parents
1cc58b51
cb53a50c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
CHANGES.rst
CHANGES.rst
+5
-0
Cython/Utility/Coroutine.c
Cython/Utility/Coroutine.c
+1
-1
tests/run/generators.pyx
tests/run/generators.pyx
+20
-0
No files found.
CHANGES.rst
View file @
db1a7dab
...
...
@@ -593,6 +593,11 @@ Bugs fixed
Also
,
related
C
compiler
warnings
about
deprecated
C
-
API
usage
were
resolved
.
(
Github
issue
#
3925
)
*
The
attributes
``
gen
.
gi_frame
``
and
``
coro
.
cr_frame
``
of
Cython
compiled
generators
and
coroutines
now
return
an
actual
frame
object
for
introspection
,
instead
of
``
None
``.
(
Github
issue
#
2306
)
0.29.23
(
2021
-
04
-
14
)
====================
...
...
This diff is collapsed.
Click to expand it.
Cython/Utility/Coroutine.c
View file @
db1a7dab
...
...
@@ -1873,7 +1873,7 @@ static PyGetSetDef __pyx_Generator_getsets[] = {
{(
char
*
)
"__qualname__"
,
(
getter
)
__Pyx_Coroutine_get_qualname
,
(
setter
)
__Pyx_Coroutine_set_qualname
,
(
char
*
)
PyDoc_STR
(
"qualified name of the generator"
),
0
},
{(
char
*
)
"gi_frame"
,
(
getter
)
__Pyx_Coroutine_get_frame
,
NULL
,
(
char
*
)
PyDoc_STR
(
"Frame of the
coroutine
"
),
0
},
(
char
*
)
PyDoc_STR
(
"Frame of the
generator
"
),
0
},
{
0
,
0
,
0
,
0
,
0
}
};
...
...
This diff is collapsed.
Click to expand it.
tests/run/generators.pyx
View file @
db1a7dab
...
...
@@ -561,3 +561,23 @@ def test_generator_kwds3(**kwargs):
a
"""
yield
from
kwargs
.
keys
()
def
test_generator_frame
(
a
=
1
):
"""
>>> gen = test_generator_frame()
>>> import types
>>> isinstance(gen.gi_frame, types.FrameType) or gen.gi_frame
True
>>> gen.gi_frame is gen.gi_frame # assert that it's cached
True
>>> gen.gi_frame.f_code is not None
True
>>> code_obj = gen.gi_frame.f_code
>>> code_obj.co_argcount
1
>>> code_obj.co_varnames
('a', 'b')
"""
b
=
a
+
1
yield
b
This diff is collapsed.
Click to expand it.
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