__slots__ , private members and properties

Cristian Echeverria cer at vtr.net
Sun Mar 9 18:11:16 EST 2003


Thanks a lot!!
Your reference show me that at least my code is ok with the concepts and 
is the raw way to use those features. Anyway, many people is trying to 
avoid the extra typing related with this features.

Cristian


Bjorn Pettersen wrote:
>>From: Cristian Echeverria [mailto:cer at vtr.net] 
>>
>>Is the atached code a good way to work with __slots__, 
>>private members 
>>and properties.
>>In the examples all the members are read-only and the code works, but 
>>I'am not sure this is the way to work with this features.
> 
> 
> Seems like an awful lot of boilerplate code. Take a look at the
> __readonly__ receipe in the Python Cookbook for a better solution
> (http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/157768).
> 
> -- bjorn
> 





More information about the Python-list mailing list