Guido's new method definition idea
Jeremiah Dodds
jeremiah.dodds at gmail.com
Sat Dec 6 20:56:22 EST 2008
On Fri, Dec 5, 2008 at 9:21 PM, Daniel Fetchinson <fetchinson at googlemail.com
> wrote:
>
> The proposal is to allow this:
>
> class C:
> def self.method( arg ):
> self.value = arg
> return self.value
>
> instead of this:
>
> class C:
> def method( self, arg ):
> self.value = arg
> return self.value
>
> I.e. explicit self stays only the syntax is slightly different and may
> seem attractive to some. As pointed out by Guido classmethods would
> work similarly:
>
> class C:
> @classmethod
> def cls.method( arg ):
> cls.val = arg
> return cls.val
>
>
-1. It doesn't solve a real problem, just shuffles syntax around with very
little, if any, gain in clarity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081206/9bc6de33/attachment-0001.html>
More information about the Python-list
mailing list