Message363154
> 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) |
|
Date |
User |
Action |
Args |
2020-03-02 11:01:22 | skrah | set | recipients:
+ skrah, rhettinger, gregory.p.smith, mark.dickinson, boytsovea |
2020-03-02 11:01:22 | skrah | set | messageid: <1583146882.16.0.454788637746.issue39794@roundup.psfhosted.org> |
2020-03-02 11:01:22 | skrah | link | issue39794 messages |
2020-03-02 11:01:22 | skrah | create | |
|