Skip to content

Instantly share code, notes, and snippets.

View blubberdiblub's full-sized avatar
🤯

Niels Boehm blubberdiblub

🤯
View GitHub Profile
@txomon
txomon / test.py
Created August 4, 2018 04:54
Python 3.7 ContextVar example in asyncio
from contextvars import ContextVar
import asyncio
import random
cv = ContextVar('cv')
async def waiting_func(name):
print(f'{name} Before sleep: {cv.get() == name}')