[Python-Dev] PEP 550 v4 (original) (raw)

Stefan Krah stefan at bytereef.org
Sun Aug 27 06:08:09 EDT 2017


On Sat, Aug 26, 2017 at 04:13:24PM -0700, Nathaniel Smith wrote:

On Sat, Aug 26, 2017 at 7:58 AM, Elvis Pranskevichus <elprans at gmail.com> wrote: > What we are talking about here is variable scope leaking up the call > stack. I think this is a bad pattern. For decimal context-like uses > of the EC you should always use a context manager. For uses like Web > request locals, you always have a top function that sets the context > vars.

It's perfectly reasonable to have a script where you call decimal.setcontext or np.seterr somewhere at the top to set the defaults for the rest of the script.

+100. The only thing that makes sense for decimal is to change localcontext() to be automatically async-safe while preserving the rest of the semantics.

Stefan Krah



More information about the Python-Dev mailing list