[issue42354] Tuple unpacking with * causes SyntaxError in with ... as ...

2020-11-14 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Already fixed with GH-22612

--
nosy: +BTaskaya
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42354] Tuple unpacking with * causes SyntaxError in with ... as ...

2020-11-14 Thread Ken Jin


Ken Jin  added the comment:

This is a duplicate of issue bpo-41979, which was already fixed in this merged 
PR https://github.com/python/cpython/pull/22611 and backported to 3.9.

The example code does not error on the latest 3.10. I'm guessing that the 
bugfix will come in 3.9.1 since the fix wasn't able to make it into 3.9.0.

--
nosy: +kj

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42354] Tuple unpacking with * causes SyntaxError in with ... as ...

2020-11-13 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
priority: normal -> high

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42354] Tuple unpacking with * causes SyntaxError in with ... as ...

2020-11-13 Thread Trey Hunner


New submission from Trey Hunner :

The below code worked on Python 3.5, 3.6, 3.7, and 3.8, but it now crashes on 
Python 3.9.


from contextlib import contextmanager


@contextmanager
def open_files(names):
yield names  # This would actually return file objects


with open_files(['file1.txt', 'file2.txt']) as (first, *rest):
print(first, rest)


The error shown is:

with open_files(['file1.txt', 'file2.txt']) as (first, *rest):
 ^
SyntaxError: invalid syntax

--
messages: 380932
nosy: trey
priority: normal
severity: normal
status: open
title: Tuple unpacking with * causes SyntaxError in with ... as ...
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com