bundles / IPython 9.11.0 / IPython / utils / decorators / flag_calls
function
IPython.utils.decorators:flag_calls
source: /IPython/utils/decorators.py :32
Signature
def flag_calls ( func : Callable[..., Any] ) → Callable[..., Any] Summary
Wrap a function to detect and flag when it gets called.
Extended Summary
This is a decorator which takes a function and wraps it in a function with a 'called' attribute. wrapper.called is initialized to False.
The wrapper.called attribute is set to False right before each call to the wrapped function, so if the call fails it remains False. After the call completes, wrapper.called is set to True and the output is returned.
Testing for truth in wrapper.called allows you to determine if a call to func() was attempted and succeeded.
Aliases
-
IPython.utils.decorators.flag_calls