PyDocs

Nav

Functional Programming Modules

partial

functools

function
  • partial(func, /, *args, **keywords)
Create a new function with partial application of the given arguments
and keywords.
Changed in 3.14
  • 3.14: Added support for Placeholder in positional arguments.
Members of partial

a

args
tuple of arguments to future partial calls

f

func
function object to use in future partial calls

k

keywords
dictionary of keyword arguments to future partial calls
1 Example
>>> basetwo = partial(int, base=2)
>>> basetwo.__doc__ = 'Convert base 2 string to an int.'
>>> basetwo('10010')
18
from the Python docs
See Also
No see-alsos for functools/partial
0 Notes
No notes for partial