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

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