[Python-Dev] None as a keyword / class methods
gvwilson@nevex.com
gvwilson@nevex.com
Thu, 23 Mar 2000 14:33:47 -0500 (EST)
Hi, Christian; thanks for your mail.
> What I would propose instead is:
> make the parameter name "self" mandatory for methods, and turn
> everything else into a static method.
In my experience, significant omissions (i.e. something being important
because it is *not* there) often give beginners trouble. For example,
in C++, you can't tell whether:
int foo::bar(int bah)
{
return 0;
}
belongs to instances, or to the class as a whole, without referring back
to the header file [1]. To quote the immortal Jeremy Hylton:
Pythonic design rules #2:
Explicit is better than implicit.
Also, people often ask why 'self' is required as a method argument in
Python, when it is not in C++ or Java; this proposal would (retroactively)
answer that question...
Greg
[1] I know this isn't a problem in Java or Python; I'm just using it as an
illustration.