Extending Python Syntax with @

Roger Binns rogerb at rogerbinns.com
Thu Mar 11 02:08:39 CET 2004


David MacQuigg wrote:
> @x @y @z        -- short for instance variables in a method definition

The explicit self in front of accesses is what bugged me the most when
I first started with Python.  (I liked the indentation.  All my
C/C++/Java code is appropriately indented anyway, so the Python
rules didn't change my indentation style, and only removed now
superfluous punctuation).

But now when I go back to C++ code, the lack of self/this bugs
me.  I often expect to not compile since I am not to sure where
it is resolving a name to.  (Try writing MFC code on PocketPC
sometime - the layers of abstractions and inheritance get to be
fun).

Of course I could use this->x in the code, but that is non-standard
and not something I would want to inflict on someone who has to
maintain the code.

   explicit is better than implicit!

Roger





More information about the Python-list mailing list