class calleedef __call__(self*pargs**kargs)print('called:'pargskargsc callee( ( called( { ( = = called( {' ' ' ' intercept instance calls accept arbitrary arguments is callable object more formallyall the argument-passing modes we explored in are supported by the __call__ method--whatever is passed to the instance is passed to this methodalong with the usual implied instance argument for examplethe method definitionsclass cdef __call__(selfabc= = )normals and defaults class cdef __call__(self*pargs**kargs)collect arbitrary arguments class cdef __call__(self*pargsd= **kargs) keyword-only argument all match all the following instance callsx ( ( ( ( = = = (*[ ]**dict( = = ) ( *( ,) = **dict( = )omit defaults positionals keywords unpack arbitrary arguments mixed modes see for refresher on function arguments the net effect is that classes and instances with __call__ support the exact same argument syntax and semantics as normal functions and methods intercepting call expression like this allows class instances to emulate the look and feel of things like functionsbut also retain state information for use during calls we saw an example similar to the following while exploring scopes in but you should now be familiar enough with operator overloading to understand this pattern betterclass proddef __init__(selfvalue)self value value def __call__(selfother)return self value other prod( ( operator overloading accept just one argument "remembers in state (passed (state