27 Aug
2017
27 Aug
'17
5:08 a.m.
On Sat, Aug 26, 2017 at 04:13:24PM -0700, Nathaniel Smith wrote:
On Sat, Aug 26, 2017 at 7:58 AM, Elvis Pranskevichus
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