Prasad, Ramit wrote: > Hi Peter, > > >>> class Magnitude(object): > > ... def __init__(self, value): > ... self.value = value > ... def __call__(self, uf=1): > ... if uf == 1: > ... return self > ... return self.value > ... > > >>> class Iron(object): > > ... def __init__(self): > ... self.rho = Magnitude(42) > ... > > > Why did you make uf=1 instead of None? > > ... def __call__(self, uf=None): > ... if uf is None:
That's a design decision of the OP. I suggested an improvement of the implementation and left the interface alone. -- http://mail.python.org/mailman/listinfo/python-list