Pronouncing '__init__'

holger krekel pyth at devel.trillke.net
Sat Jun 15 10:16:23 EDT 2002


Oren Tirosh wrote:
> On Sat, Jun 15, 2002 at 01:44:10PM +0200, holger krekel wrote:
> > for oral language:
> > 
> >     init constructor
> > 
> > and if the context allows
> > 
> >     init
> > 
> > for written languange __init__
> > 
> > Isn't it obvious? :-)
> > 
> >     holger
> 
> I used __init__ just as an example.  I meant how do you pronounce names 
> with leading and trailing double underscore in general.  The magic name 
> __init__ may be by far the one most commonly encountered in everyday 
> programming but __there__ __are__ __many__ __others__.

I guessed that :-) my rough table for common uses:

    a.__getattr__  ->  a's getattr
    a.__setattr__  ->  a's setattr 
    a.__delattr__  ->  a's delattr 
    a.__dict__     ->  a's instance/class dict
    a.__hash__     ->  a's hash function 
    a.__init__     ->  a's init method (thanks to aahz)
    a.__new__      ->  a's meta constructor (or so)
    a.__doc__      ->  a's docstring
    a.__call__     ->  a's call method

if any program dares to use these names without underscores
i handle *that* as the special more verbose case (e.g. non-underscored hash method).
the more esoteric __methods__ i like to spell 'the special xyz method'. 

under_score'ly y'rs holger





More information about the Python-list mailing list