why not extending the syntax for classes, too ?

Erik Max Francis max at alcyone.com
Sat Feb 8 03:13:09 CET 2003

Michele Simionato wrote:

> Within the proposals of extending the function syntax,
> reported on the python-dev summary recently posted on c.l.p.,
> I like the most the proposal with "is", as for instance in
> def double(x) is staticmethod:
>     return 2*x
> I like the "is" syntax more than the syntax with "as" and the syntax
> with the square brackets, especially because with "is"  it would be
> natural to extend the notation for classes, using metaclasses as class
> descriptors.

I'm lukewarm on the whole idea, but I think I'd prefer "as" to "is" in
this context.  "is" is a very important (and very specific) operator in
Python, and it's being used as an auxiliar syntax hint in a context
totally different from that which the "is" operator actually takes.

The "as" keyword, on the other hand, already exists in this auxiliary
capacity for the "import X as Y" statement, making it a much better
choice as an auxiliar signal in a syntactic context than a keyword that
already means something very specific and wholly unrelated.

 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Shooters, looters / Now I got a laptop computer
\__/ Ice Cube
    Kepler's laws / http://www.alcyone.com/max/physics/kepler/
 A proof of Kepler's laws.

More information about the Python-list mailing list