By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,035 Members | 1,324 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,035 IT Pros & Developers. It's quick & easy.

What are __slots__ used for?

P: n/a
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
Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <ri*@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
Jul 21 '05 #2

P: n/a
Most have already been said, but have a look at
http://docs.python.org/ref/slots.html for authoritative documentation.

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.