Same function but different names with different set of default arguments

Yann Kaiser kaiser.yann at gmail.com
Thu Jan 21 02:49:54 EST 2016


partial treats keyword arguments as default values, though they become
keyword-only as a result :

f1 = functools.partial(g, p="p1")

On Thu, Jan 21, 2016, 08:35 Paulo da Silva <p_s_d_a_s_i_l_v_a_ns at netcabo.pt>
wrote:

> Hi all.
>
> What is the fastest implementation of the following code?
>
> def g(p):
>         ...
>         return something
>
> def f1(p="p1"):
>         return g(p)
>
> def f2(p="p2"):
>         return g(p)
>
> Thanks
> Paulo
> --
> https://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list