[Python-ideas] Python Numbers as Human Concept Decimal System

random832 at fastmail.us random832 at fastmail.us
Tue Mar 11 20:22:43 CET 2014


On Tue, Mar 11, 2014, at 11:45, Antoine Pitrou wrote:
> I don't think that's the problem. What you call "dynamic scoping" is a 
> feature here, and "lexical scoping" wouldn't solve the issue: simply, 
> the parser and compiler run before executing any Python code, so they 
> can't see any changes in decimal precision triggered by a library call.

They could if all such changes were made by keyworded statements or
expressions (which the compiler can understand just fine) rather than
library calls. Which they would necessarily have to be if contexts were
lexically scoped, since they would have to affect the execution of
operators within their scope (probably by passing the context as a third
argument to the operator implementations) without affecting functions
called by them.


More information about the Python-ideas mailing list