Why the 'self' argument?
newsgroups at jhrothjr.com
Sat Sep 6 03:33:26 CEST 2003
"Bengt Richter" <bokr at oz.net> wrote in message
news:bjbb57$bb2$0 at 220.127.116.11...
> On Fri, 5 Sep 2003 20:15:00 -0400, "John Roth" <newsgroups at jhrothjr.com>
> >If you don't have to write "self" as the first parameter of a method,
> >that reduces the complexity. Everything else remains the same.
> Except for cases where two self-parameters are visible at the same time,
> and both are used in an inner scope and must be distinguished by giving
> them different names. ISTM you'd have to turn off some dynamic
> of python to make "self" implicit. (An example came up in a past
> some time ago).
You could still give them different names. The proposal is to eliminate
the need to specify "self" in the method header, not in the code in the
method body. That's a different issue, and I don't know of any language
that manages to do it consistently.
> Bengt Richter
More information about the Python-list