Problem with Property
Steve Holden
steve at holdenweb.com
Sat Feb 25 09:14:28 EST 2006
"none <"@bag.python.org wrote:
> I'm trying to implement a simple repeateable property mechansism so I
> don't have to write accessors for every single instance variable I have.
Please don't do that. The Python way is to use direct access to instance
variables unless there's a good reason not to.
Is there some reason why you want to run get/set code for every instance
variable access, or are you just experimenting to see whether it can be
done?
It seems particularly odd to want to put getters and setters behind
property access. What does the extra layer buy you?
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
More information about the Python-list
mailing list