3 ms·
Another useful feature of 3.7+ (also available as a backport by the same name) I’ve not seen mentioned is: ContextVars The gist is you get a single interface f
by nerdwaller 7y ago
Another useful feature of 3.7+ (also available as a backport by the same name) I’ve not seen mentioned is: ContextVars
The gist is you get a single interface for any type of threadlocal storage that also works with coroutines (asyncio). I use it pretty consistently for context logging of long running processes in our systems. However it has implications on other concurrency paradigms usages as well.
https://docs.python.org/3/library/contextvars.html https://docs.python.org/3/library/contextvars.html