Stefan Krah <[email protected]> added the comment:
> If someone builds an interpreter with this configure flag, does it break
> compatibility with anything that code may have started to expect as of 3.7?
Yes, anything that relies on the implicit context being coroutine-safe
does not work. The only test that expectedly breaks in the stdlib is:
Lib/test/test_asyncio/test_context.py
Basically you can't use operators inside coroutines in the same thread
if both coroutines use a different implicit context.
You can of course replace all operators inside coroutines by the
corresponding context methods:
# Unsafe with TLS context:
async def foo():
with localcontext(Context(prec=10)):
x = Decimal(1) / 9
# Safe, just avoid the TLS context:
async def foo():
c = Context(prec=10)
x = c.divide(Decimal(1), 9)
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39794>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com