flip¶
-
class
iteration_utilities.
flip
(x, /)¶ Class that reverses the positional arguments to a func when called.
- Parameters
- funccallable
The function that should be called with the flipped (reversed) arguments.
Examples
This can be used to alter the call to a function:
>>> from iteration_utilities import flip >>> from functools import partial >>> flipped = flip(isinstance) >>> isfloat = partial(flipped, float) >>> isfloat(10) False >>> isfloat(11.25) True
-
func
¶ (callable) The function with flipped arguments (readonly).
New in version 0.6.