initializing mutable class attributes

Aahz aahz at
Tue Aug 31 02:57:52 CEST 2004

In article <mailman.2624.1093889688.5135.python-list at>,
Shalabh Chaturvedi  <shalabh at> wrote:
>In Python you either have an __init__ or you don't. There is no 'default 
>constructor' - or if there is, it does nothing. 

Actually, that's not quite true.  Python does indeed have a default
constructor that returns the object.  This isn't particularly visible
from classic classes because there's no way to get access to a
constructor.  New-style classes make the constructor available through
__new__().  __init__() is an initializer.
Aahz (aahz at           <*>

"To me vi is Zen.  To use vi is to practice zen.  Every command is a
koan.  Profound to the user, unintelligible to the uninitiated.  You
discover truth everytime you use it."  --reddy at

More information about the Python-list mailing list