On Mon, Oct 16, 2017 at 7:44 AM, Nick Coghlan <ncoghlan at gmail.com> wrote: [..] > So going down this path would lock in the *default* semantics for the > interaction between context variables and generators as being the same as > the interaction between thread locals and generators, but would still leave > the door open to subsequently introducing an opt-in API like the > "contextvars.iter_in_context" idea for cases where folks decided they wanted > to do something different (like capturing the context at the point where > iterator was created and then temporarily switching back to that on each > iteration). I think we can still implement context isolation in generators in later versions for ContextVars. In 3.7, ContextVars will only support async tasks and threads. Using them in generators will be *documented* as unsafe, as the context will "leak out". Fixing generators in some later version of Python will then be a feature/bug fix. I expect almost no backwards compatibility issue, same as I wouldn't expect them if we switched decimal to PEP 550 in 3.7. Yury
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