Same function but different names with different set of default arguments

Yann Kaiser kaiser.yann at gmail.com
Thu Jan 21 03:45:01 EST 2016


Apparently the thread poster cannot receive email, I just received a bounce
on my previous email :-/

On Thu, Jan 21, 2016, 08:49 Yann Kaiser <kaiser.yann at gmail.com> wrote:

> 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