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
fb09adfb
Commit
fb09adfb
authored
May 15, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.29.x'
parents
553f3130
3b1b45de
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
CHANGES.rst
CHANGES.rst
+3
-0
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+1
-1
tests/run/async_def.pyx
tests/run/async_def.pyx
+27
-0
No files found.
CHANGES.rst
View file @
fb09adfb
...
...
@@ -431,6 +431,9 @@ Bugs fixed
* Complex buffer item types of structs of arrays could fail to validate.
Patch by Leo and smutch. (Github issue #1407)
* Decorators were not allowed on nested `async def` functions.
(Github issue #1462)
* C-tuples could use invalid C struct casting.
Patch by MegaIng. (Github issue #3038)
...
...
Cython/Compiler/Parsing.py
View file @
fb09adfb
...
...
@@ -2239,7 +2239,7 @@ def p_statement(s, ctx, first_statement = 0):
s
.
error
(
'decorator not allowed here'
)
s
.
level
=
ctx
.
level
decorators
=
p_decorators
(
s
)
if
not
ctx
.
allow_struct_enum_decorator
and
s
.
sy
not
in
(
'def'
,
'cdef'
,
'cpdef'
,
'class'
):
if
not
ctx
.
allow_struct_enum_decorator
and
s
.
sy
not
in
(
'def'
,
'cdef'
,
'cpdef'
,
'class'
,
'async'
):
if
s
.
sy
==
'IDENT'
and
s
.
systring
==
'async'
:
pass
# handled below
else
:
...
...
tests/run/async_def.pyx
View file @
fb09adfb
...
...
@@ -33,3 +33,30 @@ async def test_async_temp_gh3337(x, y):
([], 0)
"""
return
min
(
x
-
y
,
0
)
async
def
outer_with_nested
(
called
):
"""
>>> called = []
>>> _, inner = run_async(outer_with_nested(called))
>>> called # after outer_with_nested()
['outer', 'make inner', 'deco', 'return inner']
>>> _ = run_async(inner())
>>> called # after inner()
['outer', 'make inner', 'deco', 'return inner', 'inner']
"""
called
.
append
(
'outer'
)
def
deco
(
f
):
called
.
append
(
'deco'
)
return
f
called
.
append
(
'make inner'
)
@
deco
async
def
inner
():
called
.
append
(
'inner'
)
return
1
called
.
append
(
'return inner'
)
return
inner
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