On Sun, Oct 15, 2017 at 06:53:58AM +0200, M.-A. Lemburg wrote:
I have a hard time seeing the advantage of having a default where the context at the time of execution is dependent on where it happens rather than where it's defined.
IMO, the default should be to use the context where the line was defined in the code, since that matches the intuitive way of writing and defining code.
The behavior of also deferring the context to time of execution should be the non-standard form to not break this intuition, otherwise debugging will be a pain and writing fully working code would be really hard in the face of changing contexts (e.g. say decimal rounding changes in different parts of the code).
It would be a major change, but I also think lexical scoping would work best for the decimal context.
Isolation of modules and libraries (which IMO is a bigger problem than the often cited generator issues) would be solved.
It would probably not work best (or even at all) for the async call chain use case.