Level 10 : What is the purpose of the __call__ method in a Python class?

Author: IndraD | Tags: call | 1859+ Python FAQs | Share
odd-number | operator-overloading | operator-or | random-function | max-min | list-vs-tuple | min-max-function | method | precedence | name-mangling | global | else-statement | integer | higher-order-function | postfix | operators | overriding-methods | identifier | pass | indexing | python-django | exponentiation | loop | inheritance | list-operation | lambda-functions | magic-method | python_version | multithreading | python | memory-management | difference-between-threads-and-processes | package-management | loops | module | join | immutability | opening-files-(open()) | aggregating-data-with-functools.reduce() | operator | dictionaries | membership-operators-(in,-not-in) | condition | pickling--unpickling | thread-synchronization | numeric | integers | regular-expressions | lambda-function | attribute | multiple-inheritance | immutable-data-type | complex | file | format | library | software-design | set | binary | bitwise-operator | heap-memory | logical-operator | mathematical-function | choice | expression | control-flow | built-in-function | assignment-operators | mysql | with-statement | update | round-function | filter-function | filtering-and-indexing | math | init | sum-function | sum() | int | iterable | identity-operator | else | regular-expression | default-mutable-argument | oop | collections | def | dictionary | recurssion | data_structure | pseudocode | rollback | call | __init_subclass__ | polymorphism | encapsulation | access-modifier | encoding | counter-function | mathematics | virtual-environment | data-structure | function | data-structures | loop-control | introduction-to-python | multiprocessing | booleans | parsing-with-strptime | docstring | pandas | design-principle | string-slicing | decorator | object-attribute | why-use-multiprocessing-over-threading?-(gil) | slicing | gil | while-loops | asyncio-module | using-lists-as-stacks | list-comprehension | assignment-operator | class-and-object | working-with-dates-and-times | nested-loop | advanced-file-operations | loop-control-statements | floating-point-precision | boolean-and-non-boolean | zip | async | generator | touples | sys | parameter | python-repl | data-types | feature | data-structures-in-python | string-method | mutable | math-copysign | built-in | min-function | namespace | overflow | list-slicing | list-comprehension | string-formatting | using-else-and-finally | matplotlib | set-operation | collection | defining-functions | list-method | anchors-(^,-$) | turtle | introduction-to-threads | syntax | threading | multiple-except-blocks | using-assertions-(assertequal,-assertraises) | syntaxerror | numpy | decimal | error-handling | list | binary-operation | using-join()-and-is_alive()-methods | precedence-and-associativity | class-decorators | exception-handling | class-and-inheritance | bitwise | directory-operations | type-conversion | input-function | python-module | static-method | destructor | sorting-and-ranking | working-with-temporary-files-using-tempfile | string-concatenation | function-and-scope | application | functional-programming | working-with-file-paths | list-indexing | control-flow | keyword | filter | scientific-notation | global-keyword | inherit | shallow-copy | introduction-to-multiprocessing | append | unit-testing | installation | iterator | data-type | map-function | __future__ | logical-operator | file-handling | multiple-inheritance | global-variable | dictionary-comprehensions | invalid-list | string-method | indentation | variable | default-arguments | error | implementation | pep | list,-set,-and-dictionary-comprehensions | conversion | comparison | comment | assert | data-type-conversions | constructor | dataframe-and-series-objects | file-handling | type-conversion-and-casting | arithmetic-operation | raise | random | error-handling | descriptors | center | matrix | data-structure | joining-and-merging-dataframes | operations | string-iteration | benefit | tuple-unpacking | debugging | lambdas | reading-and-writing-files | string-slicing | lists | reading-and-writing-large-files-efficiently | typeerror | formatting-with-strftime | conditional-statement | factorial-function | datetime | python-operators | recursion | oops | key-value-pairs | operand | sets | lambda | time-series-with-pandas | head-and-tail | python-history | conditional-statement | built-in-modules | match | goto-function | asyncio | string-manipulation | while-and-for-loop | methods | print-statement | identity-operators-(is,-is-not) | string | memory | namedtuple | return-statement | compute | quantifiers-(*,-+,-?,-{}) | __all__-attribute | sorting | using-yield-in-functions | method-overloading | working-with-binary-files-(rb,-wb) | comprehension | managing-directories-with-os-and-shutil | conditional-statements | walking-through-directories-using-os.walk() | dictionary-methods | dicts | command-line-parsing | file_handling | objects | list-join | while-loop | input | tuple | sorted | list-methods-and-slicing | matrix-list-comprehension | list-comprehensions | creating-custom-modules | regex | exception-handling | slice | interpreter | tuple-methods | enumerate() | intering | literal-characters-and-special-characters | built-in-function | data-type | python-syntax-and-structure | list-mutation | logical-operation | for | reading:-read(),-readline(),-readlines() | split | zfill-function | boolean-masking | arithmetic-expression | while-else-loop | formal-and-actual-parameter | type-conversion | input-function | raise-statement | creating-and-starting-threads | thread-safe-data-structures-(queue.queue) | operator-and | array | iterators | logical-operators | control-statement | basic | mapping-function | classes | import-method | range | exception | global-variable | using-map()-for-transformations | thread | using-the-threading-module | deep-copy | syntax-error | writing:-write(),-writelines() | version | arbitrary-arguments-(*args,-**kwargs) | datetime.date,-datetime.time,-datetime.datetime | function-argument | stack | class-and-instance-variable | context-manager | handling-missing-values-(fillna,-dropna) | tuples | counter | identity-operator | id-function | generators | swapping | string-formatting | single-inheritance | indexing:-loc-vs-iloc | datatype | round | boolean | type_conversion | bitwise-operator | virtual-environment | escape-operator | fabs-function | yield | statement | using-os-and-pathlib-modules | string-methods | zip-function | copy | expand-tab | frozenset | version-check | functional-programming | generators-in-python | class | sys-module | complex-number | strings | test-discovery | syntax-error | floats | staticmethod | print | functions ...