Other notes

Terry Reedy tjreedy at udel.edu
Wed Dec 29 15:19:50 EST 2004


"Mike Meyer" <mwm at mired.org> wrote in message 
news:86acrxt0e7.fsf at guru.mired.org...
> Steve Holden <steve at holdenweb.com> writes:
>> Well, perhaps you can explain how a change that's made at run time
>> (calling the decorator) can affect the parser's compile time behavior,
>> then. At the moment, IIRC, the only way Python code can affect the
>> parser's behavior is in the __future__ module, which must be imported
>> at the very head of a module.
>
> By modifying the parsers grammer at runtime. After all, it's just a
> data structure that's internal to the compiler.

Given that xx.py is parsed in its entirety *before* runtime, that answer is 
no answer at all.  Runtime parser changes (far, far from trivial) could 
only affect the result of exec and eval.

Terry J. Reedy






More information about the Python-list mailing list