[EMAIL PROTECTED] schrieb:
I'm trying to come up with solution for adding synthetic properties to
python, similar to synthetic properties in Objective-C.
I'm playing around with doing this in a MetaClass. I can dynamically
create the attributes that will back the property, but I'm having
trouble figuring out how to dynamically generate get/set methods to
pass to the built-in property() function.
Why on earth do you want to do that? The reason synthesized properties
exist in ObjC is simply that to expose properties for key-value-coding,
one needs the getter/setters. But mostly these are boilerplate, so apple
introduced the @synthesized-annotation.
But in python, you don't need that. You use simple attributes. In the
very moment you need logic attached, use the builtin property to do so.
Diez
--
http://mail.python.org/mailman/listinfo/python-list