Ferenczi Viktor wrote: > Hello, > >>> 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. > > Py3K does not enforce any particular use of the class decorator function. > This > was only an example. > >> 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. > > AFAIK there is no such a thing as "intentionally ugly" in the Python > language. > I've never read this sentence before in manuals, tutorials, etc. > Perhaps not, but ...
http://mail.python.org/pipermail/python-dev/2005-September/056846.html regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://del.icio.us/steve.holden --------------- Asciimercial ------------------ Get on the web: Blog, lens and tag the Internet Many services currently offer free registration ----------- Thank You for Reading ------------- -- http://mail.python.org/mailman/listinfo/python-list