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 terry.reedy
Recipients Andy_kl, lys.nikolaou, pablogsal, terry.reedy
Date 2022-02-25.20:45:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645821907.9.0.822217656433.issue46838@roundup.psfhosted.org>
In-reply-to
Content
With two exceptions, nice suggestions if feasible.

>>> def foo(*args=None): pass
SyntaxError: * argument cannot have default value

>>> def foo(**kwargs=None): pass
SyntaxError: ** argument cannot have default value

Good.

>>> foo(*args=[0])
SyntaxError: cannot assign to iterable argument unpacking

>>> foo(**args={"a": None})
SyntaxError: cannot assign to keyword argument unpacking

Incomprehensible.  It seems to me that these should have same message as first two; message should not depend on proposed default.
History
Date User Action Args
2022-02-25 20:45:07terry.reedysetrecipients: + terry.reedy, lys.nikolaou, pablogsal, Andy_kl
2022-02-25 20:45:07terry.reedysetmessageid: <1645821907.9.0.822217656433.issue46838@roundup.psfhosted.org>
2022-02-25 20:45:07terry.reedylinkissue46838 messages
2022-02-25 20:45:07terry.reedycreate