A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2017-September/149287.html below:

[Python-Dev] PEP 550 v4

[Python-Dev] PEP 550 v4Ethan Furman ethan at stoneleaf.us
Thu Sep 7 08:50:44 EDT 2017
On 09/07/2017 04:39 AM, Greg Ewing wrote:

> 1) Under "Generators" it says:
>
>     once set in the generator, the context variable is guaranteed
>     not to change between iterations;
>
> This suggests that you're not allowed to set() a given
> context variable more than once in a given generator,
> but some of the examples seem to contradict that. So I'm
> not sure what this is trying to say.

I believe I can answer this part: the guarantee is that

- the context variable will not be changed while the yield is in effect -- or,
   said another way, while the generator is suspended;

- the context variable will not be changed by subgenerators

- the context variable /may/ be changed by normal functions/class methods
   (since calling them would be part of the iteration)

--
~Ethan~

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4