[New-bugs-announce] [issue45014] SyntaxError describing the error using a wrong term

Takuo Matsuoka report at bugs.python.org
Thu Aug 26 09:40:24 EDT 2021


New submission from Takuo Matsuoka <motogeomtop at gmail.com>:

The error is this:

>>> *()
  File "<stdin>", line 1
SyntaxError: can't use starred expression here


I think it's right SyntaxError is raised here, but the message is
incorrect. Indeed, many starred expressions are actually allowed
there. E.g.,

>>> *(),
()


I happen to have filed in this issue tracker the problem that the
definition of a starred expression given in the Language Reference is
incorrect.

https://bugs.python.org/issue44983

It appears all correct starred expressions and only them are allowed
at the point of the error. Thus the error appears to
be one because "*()" is not a starred expression in the correct
sense. I think the wording in the message should be corrected.

----------
components: Interpreter Core
messages: 400344
nosy: Takuo Matsuoka
priority: normal
severity: normal
status: open
title: SyntaxError describing the error using a wrong term
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45014>
_______________________________________


More information about the New-bugs-announce mailing list