What are __slots__ used for?

Casey Hawthorne caseyhHAMMER_TIME at istar.ca
Mon Jul 4 23:40:55 EDT 2005


To save a a few bytes (10?) per instance instead of having a dict to
hold attributes one has slots!

Designed for having lots of instances (millions?) at the same time to
save space!

"Ric Da Force" <ric at next-level.com.au> wrote:

>I am a C# programmer and new to the language and I am trying to debug some 
>code which uses this feature.  Can anyone elaborate on what it is and how it 
>is used?
>
>Regards,
>
>Ric 
>

--
Regards,
Casey



More information about the Python-list mailing list