The problem with "as" [was "Re: PEP 318"]

Stephen Horne steve at ninereeds.fsnet.co.uk
Wed Mar 24 04:48:00 EST 2004


On Tue, 23 Mar 2004 18:40:07 -0700, David MacQuigg <dmq at gain.com>
wrote:

>Beginners will learn very quickly that the special symbol
>means "similar to the standard syntax, but RTFM if you don't yet know
>this variation".

RTFM doesn't really work when you don't have a keyword to look up.
Symbols (and worse, odd combinations of symbols where it's hard to
tell which symbols are part of the same syntax rule and which are not)
that you've not seen before tend not to suggest where in the manual to
look.

If 'as' is too generic, then what about 'decorators'. That clearly
states what follows and can easily be looked up, making the 'RTFM'
attitude justifiable.

OTOH, there is the 'def' keyword for people to look up already in this
case.

>Does it make sense to have a general symbol for modifications of the
>simple standard syntax?

Not really. What happens when there are two different ways of
modifying the same syntax? When the first one was defined with no
awareness that another kind of modification might be needed later?

My opinion is that it is better to try to avoid symbols and
over-generic keywords, and to try to be more explicit about what the
modification actually is (in this case, decorators). Particularly
where the syntax may be infrequently used.

Of course short is sweet too. Easy answers are very rare.


-- 
Steve Horne

steve at ninereeds dot fsnet dot co dot uk



More information about the Python-list mailing list