New submission from Yurii Karabas <[email protected]>:
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 <[email protected]>
<https://bugs.python.org/issue42815>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com