[Python-Dev] PEP 550 v4 (original) (raw)

Yury Selivanov yselivanov.ml at gmail.com
Wed Sep 6 10:36:54 EDT 2017


On Wed, Sep 6, 2017 at 12:07 AM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

Yury Selivanov wrote: [..] I don't see a lot of value in trying to automagically isolate changes to global state only in generators.

Under PEP 550, if you want to e.g. change the decimal context temporarily in a non-generator function, you're still going to have to protect those changes using a with-statement or something equivalent. I don't see why the same thing shouldn't apply to generators. It seems to me that it will be more confusing to give generators this magical ability to avoid with-statements.

Greg, just to make sure that we are talking about the same thing, could you please show an example (using the current PEP 550 API/semantics) of something that in your opinion should work differently for generators?

Yury



More information about the Python-Dev mailing list