Guido's new method definition idea
Andreas Waldenburger
geekmail at usenot.de
Sat Dec 6 07:32:58 EST 2008
On Sat, 6 Dec 2008 04:02:54 -0800 (PST) bearophileHUGS at lycos.com wrote:
> class C:
> def $method(arg):
> $value = arg
>
> (Note there's no point after $, it's not currently possible).
> Ruby uses @ and @@ for similar purposes.
> I agree that the code looks worse, but also shorter to read and write,
> so in lines of code that use many instance attributes, that short $
> syntax helps keep the line shorter. So I may grow to accept this
> sugar...
>
But that is not the way Python is meant to work. There are several
tennets in the Zen of Python that don't chime well with this approach.
"self" is a speaking identifier, "$" isn't.
we've-been-through-this-ingly yours
/W
--
My real email address is constructed by swapping the domain with the
recipient (local part).
More information about the Python-list
mailing list