[New-bugs-announce] [issue42815] new thread doesn't copy context of the parent thread
Yurii Karabas
report at bugs.python.org
Sun Jan 3 06:43:34 EST 2021
New submission from Yurii Karabas <1998uriyyo at gmail.com>:
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.
----------
components: Library (Lib)
messages: 384262
nosy: uriyyo
priority: normal
severity: normal
status: open
title: new thread doesn't copy context of the parent thread
type: behavior
versions: Python 3.10
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42815>
_______________________________________
More information about the New-bugs-announce
mailing list