Message380932
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 |
|
Date |
User |
Action |
Args |
2020-11-13 20:00:30 | trey | set | recipients:
+ trey |
2020-11-13 20:00:30 | trey | set | messageid: <1605297630.46.0.898037335486.issue42354@roundup.psfhosted.org> |
2020-11-13 20:00:30 | trey | link | issue42354 messages |
2020-11-13 20:00:30 | trey | create | |
|