indentation

François Pinard pinard at IRO.UMontreal.CA
Fri Dec 3 17:49:30 EST 1999


thamelry at vub.ac.be (Thomas Hamelryck) writes:

> : I don't know how it is on other languages, but the mistake I make most is:
> : class A:
> :     def __init__():
> :         ...
> : no self... Why do I have to type it, if it's not possible to not type it?

> Funny, that doesn't bother me one bit.  [...]

Note that `self' is nothing more than a convention: you may use any name, as
long as you use it consistently within the routine.  Just write things like:

class A:
    def __init__(I_will_never_forget_that_variable_anymore):
        ...

very consistently in all your things, and soon, I'd bet you will feel strange
whenever you will see a mere '()' as an argument list to a class def! :-)

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list