A RetroSearch Logo

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

Search Query:

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

[Python-Dev] PEP 550 v4

[Python-Dev] PEP 550 v4Greg Ewing greg.ewing at canterbury.ac.nz
Thu Sep 7 03:46:16 EDT 2017
Yury Selivanov wrote:
> The PEP gives you a Task Local Storage, where Task is:
> 
> 1. your single-threaded code
> 2. a generator
> 3. an async task
> 
> If you correctly use context managers, PEP 550 works intuitively and
> similar to how one would think that threading.local() should work.

My version works *more* similarly to thread-local storage,
IMO.

Currently, if you change the decimal context without using
a with-statement or something equivalent, you *don't*
expect the change to be confined to the current function
or sub-generator or async sub-task.

All I'm asking for is one consistent rule: If you want
a context change encapsulated, use a with-statement. If
you don't, don't.

Not only is this rule simpler than yours, it's the
*same* rule that we have now, so there is less for
users to learn.

-- 
Greg
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