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