Skip to content
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: Allow same r.h.s. in annotated assignments as in normal ones #11667

Merged
merged 6 commits into from
Jan 25, 2019

Conversation

ilevkivskyi
Copy link
Member

@ilevkivskyi ilevkivskyi commented Jan 24, 2019

@ilevkivskyi
Copy link
Member Author

Should we also backport this to 3.7?

@ilevkivskyi
Copy link
Member Author

Hm, actually there was an old test checking that x: tuple = 1, 2 fails with syntax error. So maybe it was actually a conscious decision to prohibit this. I don't remember. Anyway, I don't have a strong preference here, so @gvanrossum @rhettinger I leave the decision up to you.

@ilevkivskyi
Copy link
Member Author

OK, after more careful reading of PEP 526, I found this:

Only single assignment targets and single right hand side values are allowed.

So it was a deliberate decision. The PEP is final now, so I would propose to just close this, unles @rhettinger really thinks we need to allow omitting parentheses.

@gvanrossum
Copy link
Member

This was meant to guard against interpretations like

var1: type = 1, var2 = 2

@gvanrossum
Copy link
Member

Sorry, too soon.

I think that worry was unneeded and agree with Raymond.

We can change it in 3.8 but no backport.

@ilevkivskyi
Copy link
Member Author

This was meant to guard against interpretations like var1: type = 1, var2 = 2

I think it would make sense to add a tests that this particular code still fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants