I would like to build a method inside a class with default values arguments taken from this class. In general I do filtering on some data. Inside my class I have a method wh
Default arguments get evaluated only once, when the definition is executed. Instead, do this:
def doSomething(self, a=None): if a is None: a = self.z self.z = 3 self.b = a
See also http://docs.python.org/release/3.3.0/tutorial/controlflow.html#more-on-defining-functions.