Python Programming - Classes - Discussion
Discussion Forum : Classes - General Questions (Q.No. 12)
12.
In Python, what is the purpose of the
__slots__
attribute in a class?
Answer: Option
Explanation:
The
__slots__
attribute in a class is used to explicitly declare a list of allowed attributes for instances of the class. It can help in saving memory by preventing the creation of additional instance attributes.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers