using names before they're defined

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Wed Jul 19 15:16:04 EDT 2006


davehowey at f2s.com a écrit :
>>Even if you need to do something during attachment of components it is
>>more Pythonic to use properties. So you will write a method in your
>>class name something like _set_up(self,upstream_obj) an  _get_up(self).
>> And then at the end of your class put up=property(_get_up, _set_up).
>>You can still use the compr.up=... format.
> 
> 
> sorry, I don't quite follow. what are properties?
> 
Computed attributes. cf
http://www.python.org/doc/2.2.3/whatsnew/sect-rellinks.html#SECTION000340000000000000000







More information about the Python-list mailing list