Message384086
Well, there is actually a bug:
f1b4a742d8fc">root@f1b4a742d8fc:/# python3.9
Python 3.9.1 (default, Dec 8 2020, 03:24:52)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = [1, 2]
>>> y = 3
>>> *x, y
(1, 2, 3)
>>> (*x), y
File "<stdin>", line 1
(*x), y
^
SyntaxError: can't use starred expression here
f1b4a742d8fc">root@f1b4a742d8fc:/# python3.8
Python 3.8.6 (default, Oct 6 2020, 03:22:36)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = [1, 2]
>>> y = 3
>>> *x, y
(1, 2, 3)
>>> (*x), y
(1, 2, 3)
This is different from the previous message where the starred expression is "alone" (and thus invalid). Since this bug happens in 3.9 but not in 3.8, it might be due to the PEG parser.
Also,
f1b4a742d8fc">root@f1b4a742d8fc:/# python3.9
Python 3.9.1 (default, Dec 8 2020, 03:24:52)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> del *x
File "<stdin>", line 1
del *x
^
SyntaxError: cannot delete starred
>>> del (*x)
File "<stdin>", line 1
del (*x)
^
SyntaxError: can't use starred expression here
The latter case should also report "SyntaxError: cannot delete starred". |
|
Date |
User |
Action |
Args |
2020-12-30 20:29:36 | gousaiyang | set | recipients:
+ gousaiyang, gvanrossum, lys.nikolaou, pablogsal |
2020-12-30 20:29:36 | gousaiyang | set | messageid: <1609360176.44.0.755006542272.issue40631@roundup.psfhosted.org> |
2020-12-30 20:29:36 | gousaiyang | link | issue40631 messages |
2020-12-30 20:29:36 | gousaiyang | create | |
|