|
|
|
|
|
by masklinn
2100 days ago
|
|
> What you describe basically is how dynamic scoping is mechanically implemented under the hood. It's certainly how that's commonly emulated but that can leak out e.g. CPython uses threadlocals for decimal contexts, but if you set a localcontext in a coroutine / generator and suspend that, the information leaks out. I assume the same happens with gevent unless you `patch_thread()`, and even then that assumes `decimal` always deref's threadlocals from the python-level module rather than statically resolve them. |
|