[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-35814: Update the annotated assignment docs #13757

Merged
merged 1 commit into from Jun 2, 2019

Conversation

Copy link
Member

ilevkivskyi commented Jun 2, 2019

cc @gvanrossum @rhettinger

Btw, when writing this I am now thinking is there a reason why we don't allow also star expressions in the r.h.s. of annotated assignments (so that it mirrors normal assignment, not augmented assignment)? For example t: Tuple[int, ...] = x, y, *z is a SyntaxError. Should we try allowing this? Or is it too late in the release cycle?

https://bugs.python.org/issue35814

Copy link
Member Author

ilevkivskyi commented Jun 2, 2019

See python/peps#1096 for the corresponding PEP update.

Copy link
Member

gvanrossum left a comment

Re: whether to allow x, y, *z on the RHS, I guess PEP 526 again doesn't specify this either way. I vaguely recall that during the discussion we weren't too sure about various extensions, but perhaps the most important thing we didn't want to allow was multiple variables (e.g. x, y: int would be ambiguous).

I'm okay with allowing that, and it's probably better to do it sooner than later. The fix presumably is very simple (just update the grammar) but I'd request a test to make sure we didn't miss anything obvious in the code generation. (But x: Tuple[int, ...] = (1, 2, *xs) does work, so probably nothing.)

Copy link
Member Author

ilevkivskyi commented Jun 2, 2019

OK, I will make a separate PR tomorrow (it is almost 1AM here).

ilevkivskyi merged commit 82eac26 into python:master Jun 2, 2019
ilevkivskyi deleted the update-annasign-docs branch Jun 2, 2019
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants