Arthur wrote: > Spending the morning avoiding responsibilities, and seeing what it would > take to color some complex numbers. > > class color_complex(complex): > def __init__(self,*args,**kws): > complex.__init__(*args) > self.color=kws.get('color', 'BLUE')
In general when you subclass an immutable type you have to override __new__ rather than __init__. There is some explanation and example here: http://www.python.org/2.2.3/descrintro.html#__new__ Kent -- http://mail.python.org/mailman/listinfo/python-list