S
spinach
Explicit is better than implicit.
import sarcasm
def whatAboutMyImplicitModuleMethod()
Explicit is better than implicit.
Fernando said:i was just wondering about the need to put "self" as the first
parameter in every method a class has because, if it's always needed,
why the obligation to write it? couldn't it be implicit?
Or is it a special reason for this being this way?
Aahz said:[...]Because Python has no declarations there must be a different way to
indicate in which category an identifier falls.
Any objection to swiping this for the FAQ? (Probably with some minor
edits.)
Aahz said:[...]Because Python has no declarations there must be a different way to
indicate in which category an identifier falls.
Any objection to swiping this for the FAQ? (Probably with some minor
edits.)
There is already a 'self' section (1.4.4) in the official Python FAQ.
Looks like this has been forgotten. Perhaps it would be helpful to
create a short version of the FAQ with the top most frequently asked
questions/stumbling blocks/annoyances titled "top 10 things you always
wanted to know about Python and didn't dare to ask" and post it weekly
in this newsgroup![]()
Fernando said:Hi,
i was just wondering about the need to put "self" as the first
parameter in every method a class has because, if it's always needed,
why the obligation to write it? couldn't it be implicit?
Or is it a special reason for this being this way?
Thanks.
No.
The global/local stuff needs a bit more nuance (assignments in the method
being the criterium).
The reason can be found in the output from the python statement "import
this". Explicit is better than implicit.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.