can't add variables to instances of built-in classes

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Mon Jul 18 17:48:01 EDT 2016


On Monday, July 18, 2016 at 7:39:09 PM UTC+12, Peter Otten wrote:
> Lawrence D’Oliveiro wrote:
> 
>> I find __slots__ very useful. I have them right through my Qahirah classes
>> <https://github.com/ldo/qahirah>, for example.
> 
> Or is there something I didn't think of that makes them useful for you?

When you have lots of read/write properties, I find __slots__ to be a good idea.



More information about the Python-list mailing list