Hacker News new | past | comments | ask | show | jobs | submit login

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




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: