Basically, what I\'d like to do is:
>>> from functools import partial
>>> partial(str.startswith, prefix=\'a\')(\'a\')
Traceback (most rece
If you really need this you can use rpartial from funcy
3rd-party library.
Its code is here:
def rpartial(func, *args):
return lambda *a: func(*(a + args))
So, your case can be handled as following:
>>> startswith_a = rpartial(str.startswith, 'a')
>>> startswith_a('abc')
True
>>> startswith_a('def')
False