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

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