return_called

iteration_utilities.return_called(func, /)

Return the result of func().

Parameters
funccallable

The function to be called.

Returns
resultany type

The result of func().

Examples

This function is equivalent to lambda x: x() but significantly faster:

>>> from iteration_utilities import return_called
>>> return_called(int)
0