On Fri, Feb 27, 2009 at 5:59 AM, Ravi <ra.ravi....@gmail.com> wrote: > Is it possible in python to create a property with the same name as > the member variable name of the class. e.g.
No, because accessing the property and the instance variable are *syntactically identical* (it's the raison detre of properties) so there's no way for Python to know which one you mean when. Typically, people name the variable used internally by the property as an underscore followed by the property name (e.g. self._i). > Class X: > ... > self.i = 10 # marker > ... > property(fget = get_i, fset = set_i) Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list