New PEP: The directive statement

Joshua Marshall jmarshal at mathworks.com
Fri Mar 23 15:45:35 CET 2001


Martin von Loewis <loewis at informatik.hu-berlin.de> wrote:
> scarblac at pino.selwerd.nl (Remco Gerlich) writes:

>> First the inconsistency: the syntax definition in (C) claims that some
>> restrictions on the placement of directive may be in place, depending on
>> the directive. However, (D) notes that directives must appear as the first
>> non-string token in a file, for backwards compatibility. So in practice,
>> directive can't be used anywhere in a file.

> That's not inconsistent. There is only one directive defined so far,
> to activate nested scopes, and it must appear at the top of the file.
> In some later release of Python, directive will become a proper
> keyword, at which time introducing directives with less strict
> placement rules is possible.

Please, no more keywords.  It's unnecessary in this case.
How about an interpreter switch:

  python -directive nested_scopes fu.py



More information about the Python-list mailing list