Properties for modules?

James Stroud jstroud at mbi.ucla.edu
Tue Jun 12 00:08:23 CEST 2007


James Stroud wrote:
> # moduleFoo.py
> 
> def get_setting(self, name):
>   return do_whatever(name)
> 
> def set_setting(self, name, arg):
>   return do_whatever_else(name, arg)
> 
> class Foo(object):
>   someSetting = property(set_setting, get_setting)
> 
> foo = Foo()


   someSetting = property(set_setting, get_setting)

should be

   someSetting = property(get_setting, set_setting)

James



More information about the Python-list mailing list