On Sep 5, 9:59 pm, Ferenczi Viktor <[EMAIL PROTECTED]> wrote: > Class decorators allows clean implementation of properties. > Detailed description:http://www.python.org/dev/peps/pep-3129/ > Lets use a hypothetic library providing properties, for example: > > from property_support import hasProperties, Property > > @hasProperties > class Sphere(object): > def setRadius(self, value): > ... some setter implementation ... > radius=Property(default=1.0, set=setRadius, type=(int, float)) > color=Property(default='black', allowNone=True) > > This is a cleaner syntax if you need automatic default setter/getter > implementations with type checking, default values, etc.
I really distaste this "etc." in your description. In the end you promote endless lists of command line parameters to configure every possible function. I also doubt that the solution is more clean but arbitray instead. My own guess why properties are not promoted with more emphasis is that they lead to cargo cult programming i.e. everyone starts to use property syntax even when usual attributes are sufficient. So the syntax might even be intentionally ugly. -- http://mail.python.org/mailman/listinfo/python-list