Level 10 : What is the purpose of the __slots__ attribute in a Python class?

Author: IndraD | Tags: class | 1736+ Python FAQs | Share
namedtuple | boolean | iterable | file-handling | string-iteration | immutability | syntax-error | identifier | random-function | python | math | virtual-environment | memory | class-and-instance-variable | regex | parameter | asyncio | method | context-manager | operator-overloading | yield | global-keyword | oops | round | format | list-indexing | control-statement | python-repl | higher-order-function | update | formal-and-actual-parameter | operator | inherit | asyncio-module | data-type | pseudocode | comparison | file_handling | numpy | split | zip | lambda-function | type_conversion | input-function | expression | tuple-unpacking | built-in-function | dictionary | data-structure | mathematical-function | list-method | collection | dictionaries | loops | touples | binary-operation | tuple | decimal | counter | data-type | raise | rollback | escape-operator | round-function | loop-control | comment | string-formatting | static-method | type-conversion | python-django | min-max-function | assert | immutable-data-type | multiple-inheritance | logical-operation | global | list | exception-handling | application | virtual-environment | binary | library | mapping-function | join | __future__ | string-method | mysql | generators-in-python | set | syntax-error | slicing | comprehension | objects | keyword | range | version-check | exception-handling | async | center | counter-function | installation | memory-management | sorting | complex-number | python-history | sum-function | pandas | precedence | class-and-object | invalid-list | zip-function | attribute | datetime | list-vs-tuple | multithreading | functional-programming | bitwise-operator | expand-tab | typeerror | inheritance | identity-operator | for | list-comprehension | syntaxerror | head-and-tail | destructor | print-statement | list-mutation | floating-point-precision | staticmethod | assignment-operator | swapping | mutable | string-manipulation | error-handling | init | matrix-list-comprehension | identity-operator | recursion | frozenset | exponentiation | operator-and | collections | generators | string-method | overflow | conditional-statement | encoding | list-operation | enumerate() | call | class-and-inheritance | map-function | list-slicing | pickling-&-unpickling | set-operation | variable | array | benefit | goto-function | shallow-copy | loop | global-variable | min-function | indentation | object-attribute | magic-method | nested-loop | feature | int | string | __all__-attribute | classes | name-mangling | else-statement | thread | arithmetic-operation | print | boolean-and-non-boolean | fabs-function | access-modifier | factorial-function | postfix | implementation | random | match | indexing | conditional-statement | while-and-for-loop | sum() | return-statement | mathematics | polymorphism | complex | list-join | math-copysign | descriptors | matrix | file-handling | functions | generator | zfill-function | basic | logical-operator | exception | built-in-function | gil | sys-module | lambdas | decorator | operators | stack | module | bitwise-operator | import-method | matplotlib | multiprocessing | function-argument | string-concatenation | input | data-structure | def | operations | threading | control-flow | __init_subclass__ | list-comprehension | methods | choice | bitwise | slice | with-statement | control-flow | built-in | global-variable | arithmetic-expression | sys | integer | syntax | dicts | file | data_structure | software-design | function | default-mutable-argument | precedence-and-associativity | scientific-notation | max-min | design-principle | constructor | python-module | conversion | debugging | turtle | input-function | iterator | interpreter | deep-copy | odd-number | statement | string-slicing | condition | encapsulation | data-structures | string-formatting | version | while-else-loop | error | numeric | docstring | regular-expression | namespace | sorted | class | string-slicing | operand | filter-function | while-loop | append | function-and-scope | pep | operator-or | type-conversion | logical-operator | compute | python_version | filter | command-line-parsing | oop | copy | datatype | heap-memory | lists | id-function | recurssion | package-management | lambda ...