[2.7] bpo-10544: Deprecate "yield" in comprehensions and generator expressions in Py3k mode. (GH-4579)#4676
Merged
serhiy-storchaka merged 3 commits intopython:2.7from Dec 2, 2017
Conversation
…ons in Py3k mode. (pythonGH-4579)
ncoghlan
approved these changes
Dec 2, 2017
Contributor
ncoghlan
left a comment
There was a problem hiding this comment.
This looks good to me, just one request for an explanatory comment on the new list comp checking code.
Python/symtable.c
Outdated
| { | ||
| asdl_seq *generators = e->v.ListComp.generators; | ||
| int i; | ||
| int is_generator = st->st_cur->ste_generator; |
Contributor
There was a problem hiding this comment.
I missed the addition of is_generator on my first read-through of this function, so I think it could use an explanatory comment. Something like:
/* In order to check for yield expressions under '-3', we clear the generator flag, and restore it at the end */
Member
Author
|
Thanks @ncoghlan! |
Contributor
|
This is on the 2.7 branch, not the 3.7 branch. In 3.7b1 this is currently not a deprecation warning. Wrong branch perhaps? |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
They will be deprecated in Python 3.7 and prohibited in Python 3.8.
https://bugs.python.org/issue10544