Statement local namespaces summary (was Re: python3: 'where' keyword)
Nick Coghlan
ncoghlan at iinet.net.au
Mon Jan 10 08:07:45 EST 2005
Nick Coghlan wrote:
> Disallowing local namespaces for statement lists would suggest something
> like this:
>
> statement ::= (simple_stmt
> (NEWLINE | ";" stmt_list NEWLINE | local_namespace)
> ) |
> (compound_stmt [local_namespace])
> local_namespace ::= "with" ":" suite
>
Corrected version of the above to avoid an unintended syntax change:
statement ::= (simple_stmt
(NEWLINE | ";" [stmt_list] NEWLINE | local_namespace)
) |
(compound_stmt [local_namespace])
local_namespace ::= "with" ":" suite
(The original version incorrectly prohibited a trailing semi-colon for a single
statement)
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at email.com | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.skystorm.net
More information about the Python-list
mailing list