Python: How to pass more than one argument to the property getter?
Note that you don’t have to use property as a decorator. You can quite happily use it the old way and expose the individual methods in addition to the property: class A: def get_x(self, neg=False): return -5 if neg else 5 x = property(get_x) >>> a = A() >>> a.x 5 >>> a.get_x() 5 >>> … Read more