Why self?

Alex Martelli aleax at aleax.it
Tue Jul 9 17:16:04 EDT 2002


Robb Shecter wrote:
        ...
> So again, I think that this does highlight the implicit nature of Python

I think it most definitely does no such thing,

> - when you grab an object out of a container, you can send whatever
> message you want to it.  You don't have to explicitly state what class
> you think it is.

And the reason you don't have to state that, is that it makes absolutely
no difference whatsoever -- you can try to get any attribute (methods
included) from any object, it either succeeds or fails (and that only
partly depends on the object's class).

Claiming that being able to not state such irrelevant things "highlights
the implicit nature of Python" is just like saying that it "highlights
the implicit nature of Python" that you don't have to state on what
day of the week and at what time of day you wrote each function.  It
just doesn't matter, so OF COURSE you don't have to state it.  Sheesh.

Of course code written early on monday morning, or very late at night,
will tend to be more buggy.  Yet, all languages are so "implicit" that
they don't force you to timestamp all your code.  Just imagine...!


Alex




More information about the Python-list mailing list