Message384262
New thread doesn't copy context of the parent thread.
The minimal example to reproduce the issue:
```
from threading import Thread
from contextvars import ContextVar
foo: ContextVar[str] = ContextVar("foo")
def temp():
print(foo.get())
foo.set("bar")
t = Thread(target=temp)
t.start()
t.join()
```
Is it expected behavior?
PEP 567 I didn't find anything regarding this case. |
|
Date |
User |
Action |
Args |
2021-01-03 11:43:34 | uriyyo | set | recipients:
+ uriyyo |
2021-01-03 11:43:34 | uriyyo | set | messageid: <1609674214.71.0.941381845328.issue42815@roundup.psfhosted.org> |
2021-01-03 11:43:34 | uriyyo | link | issue42815 messages |
2021-01-03 11:43:34 | uriyyo | create | |
|