Thanks! that works now!
On Fri, Oct 17, 2008 at 9:11 PM, Chris Rebert <[EMAIL PROTECTED]> wrote:
> Since rwproperty appears to use descriptors just like regular
> property(), you'd do it the same way as for any normal attribute,
> namely:
>
> #for reading
> print foo.y
> #is the same as
> print ge
=?KOI8-R?B?7cnU0Q==?= wrote in news:f1a77a69-2997-4f53-9a46-
[EMAIL PROTECTED] in comp.lang.python:
>
> class Film(object):
> def __init__(self, title):
> self.__title = title
>
> @getproperty
> def title(self):
> return self.__title
> @setproperty
> def title
Since rwproperty appears to use descriptors just like regular
property(), you'd do it the same way as for any normal attribute,
namely:
#for reading
print foo.y
#is the same as
print getattr(foo, "y")
#for writing
foo.x = 1
#is the same as
setattr(foo, "x", 1)
Cheers,
Chris
--
Follow the path
I use rwproperty (http://pypi.python.org/pypi/rwproperty/1.0) and so I
have properties in my class. Also I have a list of names of properties
wich I am to set. How can I access my properties by name in such way
that when I want to set a property, setter will be called, and and
when I want to read i