Hallöchen!

Ferenczi Viktor writes:

> [...]
>
> 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.

Well, I think @hasProperties is very ugly.  Such things always look
like a dirty trick.  The programmer wonders why the language cannot
detect by itself that there are properties in this class.  But
anyway ... would these properties finally be virtual?

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
                                      Jabber ID: [EMAIL PROTECTED]
                      (See http://ime.webhop.org for ICQ, MSN, etc.)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to