-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --without-decimal-contextvar option to use just threads in decimal #83975
Comments
Also, when I'm debugging things like bpo-39776, I don't want to |
While i don't think this was needed in 3.7 and 3.8, you kept the default behavior the same so I don't think it is a problem. 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? |
+1 for the backport. A build option isn't new feature, but it does provide a debugging tool and work-around for people who are having problems. |
For the people who find this issue via a search engine:
|
Yes, anything that relies on the implicit context being coroutine-safe Lib/test/test_asyncio/test_context.py Basically you can't use operators inside coroutines in the same thread You can of course replace all operators inside coroutines by the # 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) |
To make things more clear (it is good that Gregory asked): ONLY use this flag if you don't use coroutines at all Random async libraries from PyPI may rely on the |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: