from operator import methodcaller s = 'The time has come' upcase = methodcaller('upper') upcase(s) 'THE TIME HAS COME' hiphenate = methodcaller('replace', ' ', '-') hiphenate(s) 'The-time-has-come'
from operator import mul from functools import partial triple = partial(mul, 3) ➊ triple(7) ➋