mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-41979: Accept star-unpacking on with-item targets (GH-22611)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
666f583e9e
commit
48f305fd12
4 changed files with 18 additions and 8 deletions
|
@ -182,7 +182,7 @@ with_stmt[stmt_ty]:
|
|||
| ASYNC 'with' a[asdl_withitem_seq*]=','.with_item+ ':' tc=[TYPE_COMMENT] b=block {
|
||||
CHECK_VERSION(5, "Async with statements are", _Py_AsyncWith(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA)) }
|
||||
with_item[withitem_ty]:
|
||||
| e=expression 'as' t=target &(',' | ')' | ':') { _Py_withitem(e, t, p->arena) }
|
||||
| e=expression 'as' t=star_target &(',' | ')' | ':') { _Py_withitem(e, t, p->arena) }
|
||||
| invalid_with_item
|
||||
| e=expression { _Py_withitem(e, NULL, p->arena) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue