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 gvanrossum
Recipients gousaiyang, gvanrossum, lys.nikolaou, pablogsal, serhiy.storchaka
Date 2020-12-30.23:41:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609371678.21.0.702501119083.issue40631@roundup.psfhosted.org>
In-reply-to
Content
> It makes sense to me to be able to do `(*a), b` if I can do `*a, b`, but I don't really have a strong opinion on it.

I disagree. *a is not an expression, so the normal rules for parenthesizing those don't apply. I've always thought of *a as a feature of the "comma" syntax. Note too that (**a) is not valid and never was. Also note that 2.7 doesn't support f((*a)). In fact 3.4 doesn't either -- but 3.5 does.

I don't know how this slipped into earlier Python 3 versions -- apparently there aren't tests for this, and it's not used in popular 3rd code either, or we would have found out when we first implemented PEP 617.

Most likely it's due to the general problem where the parser would just accept parenthesized stuff in various places where it shouldn't (e.g. also f(a=1) could be spelled as f((a)=1) -- this was fixed in 3.8).

> Also the current behavior allows `(*x), y = 1` assignment. If `(*x)` is to be totally disallowed, `(*x), y = 1` should also be rejected.

I agree.
History
Date User Action Args
2020-12-30 23:41:18gvanrossumsetrecipients: + gvanrossum, serhiy.storchaka, lys.nikolaou, pablogsal, gousaiyang
2020-12-30 23:41:18gvanrossumsetmessageid: <1609371678.21.0.702501119083.issue40631@roundup.psfhosted.org>
2020-12-30 23:41:18gvanrossumlinkissue40631 messages
2020-12-30 23:41:18gvanrossumcreate