-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
[2.7] bpo-10544: Deprecate "yield" in comprehensions and generator expressions in Py3k mode. (GH-4579) #4676
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
[2.7] bpo-10544: Deprecate "yield" in comprehensions and generator expressions in Py3k mode. (GH-4579) #4676
Conversation
…ons in Py3k mode. (pythonGH-4579)
ncoghlan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 */
|
Thanks @ncoghlan! |
|
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? |
They will be deprecated in Python 3.7 and prohibited in Python 3.8.
https://bugs.python.org/issue10544