New PEP: The directive statement

piet at cs.uu.nl piet at cs.uu.nl
Wed Mar 21 06:39:30 EST 2001


>>>>> "Fredrik Lundh" <fredrik at pythonware.com> (FL) writes:

FL> Aahz Maruch wrote:
>> >except that "import" already is a declaration statement, of course.
>> 
>> Depends how you define "already".  There is no current released version
>> of Python (alphas and betas do not count as "released versions") in
>> which "import" is a declaration.

FL> import declares things, in all existing Python versions (hint: it's
FL> an assignment statement)

On the other hand, the effect of import is the same as the calling of the
magical __import__ function, of which the definition says:
This function is invoked by the import statement (not declaration).
And it is done at runtime, not compiletime.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl



More information about the Python-list mailing list