return_first_arg

iteration_utilities.return_first_arg(*args, **kwargs)

Always return the first positional argument given to the function.

Parameters:

args, kwargs

any number of positional or keyword parameter.

Returns:

first_positional_argument : any type

Always returns the first positional argument given to the function.

Examples

This function is equivalent to lambda *args, **kwargs: args[0] but significantly faster:

>>> from iteration_utilities import return_first_arg
>>> return_first_arg(1, 2, 3, 4, a=100)
1