return_called

iteration_utilities.return_called(func, /)

Return the result of func().

Parameters:

func : callable

The function to be called.

Returns:

result : any 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