On Wed, Jan 3, 2018 at 5:42 PM, Victor Stinner <victor.stin...@gmail.com> wrote: > Hi, > > It seems like many people, including myself, are confused by the lack > of concrete current context in the PEP 567 (contextvars). But it isn't > difficult to implement the current context (I implemented it, see > below).
The problem with such an API is that it doesn't work (or at the very least creates a lot of complications) in a potential future PEP 550 world, where the "current context" becomes something like a ChainMap-of-Contexts instead of just the last Context that had run() called on it. This isn't a big problem for contextvars.get_context(), which returns a snapshot of the current context -- in a PEP 550 world it would return a snapshot of the current "effective" (flattened) context. Maybe it would help a little to rename get_context() to something like snapshot_context()? -n -- Nathaniel J. Smith -- https://vorpus.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com