inversion_ideas.decorators.CountCalls#
- class inversion_ideas.decorators.CountCalls(func)#
Class decorator to count function calls.
Methods
__call__(*args, **kwargs)Call self as a function.
Examples
>>> @CountCalls ... def my_function(x): ... return x**2 >>> my_function(1) 1 >>> my_function(2) 4 >>> my_function.counts 2
Methods#
Methods documentation
- CountCalls.__call__(*args, **kwargs)#
Call self as a function.