[EMAIL PROTECTED] writes: > Hello everybody! > I have little problem: > > class A: > def __init__(self, n): > self.data = n > def f(self, x = ????) > print x > > All I want is to make self.data the default argument for self.f(). (I > want to use 'A' class as following :
Store your default value in a container, and test for it: class A: _data = [None] def __init__(self, n): self._data = [n] def f(self, x = _data): if x is self._data: x = x[0] print x There are lots of variations on this theme. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list