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

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