|
|
 |
Jython-users
Re: [Jython-users] Why is self used so much
by Doug Landauer other posts by this author
Feb 28 2002 8:49PM messages near this date
[Jython-users] Why is self used so much
|
Re: [Jython-users] Why is self used so much
> ... wondering why it seems that every variable used has to
> have self prefixed to it.
Global and local variables do not require the "self." prefix;
it is only members -- aka instance variables -- and methods
that require this.
> I'd just like to know why this is needed or if im doing something wrong.
Or both! (Your error is not capitalizing the "I" and omitting
the apostrophe. Mine is in pointing that out. You're welcome...)
See http://www.python.org/doc/Humor.html#zen ... the second item says
Explicit is better than implicit.
That's the guiding principle for why this part of the language
was designed this way.
channeling-the-Tim-bot-channeling-Guido-ly,
-- Doug
_______________________________________________
Jython-users mailing list
Jython-users@[...].net
https://lists.sourceforge.net/lists/listinfo/jython-users
Thread:
Martin
Doug Landauer
hamish
|
|
|
 |
|