is Python fully object oriented ?

Max Møller Rasmussen maxm at normik.dk
Fri Jan 12 04:33:28 EST 2001


From: Simon Brunning [mailto:SBrunning at trisystems.co.uk]

>> I don't know if this helps, but it's perfectly legal to use a name other
>> than "self" in Python, e.g.,
>> 
>> class SpamChunk:
>>   def __init__(s):
>>     s.color = 'green'
>> 
>It's also legal never to wash, but you won't make many friends that way,
>either.

It's the only thing about Python that bothers me endlessly, having to
explicitly pass "self".

In javascript ie. "this" is implicit and that is so much simpler.

I know it breaks the rule of "Explicit is better than implicit" but this
ought to to be an exception as it is so commonly used. (And I so commonly
make the mistake of forgetting it ;-) )

Is there a REALLY good reason that it has to be explicitly declared ?

Regards Max M




More information about the Python-list mailing list