This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gousaiyang
Recipients gousaiyang, gvanrossum, lys.nikolaou, pablogsal
Date 2020-12-30.20:29:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609360176.44.0.755006542272.issue40631@roundup.psfhosted.org>
In-reply-to
Content
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".
History
Date User Action Args
2020-12-30 20:29:36gousaiyangsetrecipients: + gousaiyang, gvanrossum, lys.nikolaou, pablogsal
2020-12-30 20:29:36gousaiyangsetmessageid: <1609360176.44.0.755006542272.issue40631@roundup.psfhosted.org>
2020-12-30 20:29:36gousaiyanglinkissue40631 messages
2020-12-30 20:29:36gousaiyangcreate