> Michael Chermside wrote:
> > Ian Bicking writes:
> >> I propose that the self argument be removed from method definitions.
> >
> > This is not a new proposal. The fundamental problem is a perceived
> > mismatch between the argument list used for calling and the argument
> > list used in defining the method. Of the many times that it has been
> > proposed, the best syntax I have seen was as follows:
> >
> >     def self.my_method(arg1, arg2):
> >         # body goes here

-1 to this version and to Ian's original proposal. You can save your
breath, or write up a PEP with the goal of explaining why this
proposal (which keeps coming back) is a bad idea -- such a PEP would
be a good idea but it won't get the feature accepted.

Capsule argument Ian's original proposal: you're proposing to hide a
fundamental truth in Python, that methods are "just" functions whose
first argument can be supplied using syntactic sugar in the call
(x.foo() instead of x.__class__.foo(x)).

And against the "def self.foo(x):" syntax: that's a lot of new syntax
for no gain in readability. You just need to get your head around the
fundamental truth (see above), just like you should get used to
reading " ".join(list_of_strings).

--
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to