Author skrah
Recipients boytsovea, gregory.p.smith, mark.dickinson, rhettinger, skrah
Date 2020-03-02.11:01:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583146882.16.0.454788637746.issue39794@roundup.psfhosted.org>
In-reply-to
Content
> 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)
History
Date User Action Args
2020-03-02 11:01:22skrahsetrecipients: + skrah, rhettinger, gregory.p.smith, mark.dickinson, boytsovea
2020-03-02 11:01:22skrahsetmessageid: <1583146882.16.0.454788637746.issue39794@roundup.psfhosted.org>
2020-03-02 11:01:22skrahlinkissue39794 messages
2020-03-02 11:01:22skrahcreate