Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #101950

Re: Same function but different names with different set of default arguments

From Yann Kaiser <kaiser.yann@gmail.com>
Newsgroups comp.lang.python
Subject Re: Same function but different names with different set of default arguments
Date 2016-01-21 08:45 +0000
Message-ID <mailman.142.1453365911.15297.python-list@python.org> (permalink)
References <n7q1ds$11rf$1@gioia.aioe.org> <CANUJvPUXhSyRRU2dJrdjP9qsaKX4ZCN7ioms6V4W9CgtTFcFcQ@mail.gmail.com>

Show all headers | View raw


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@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@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
>>
>

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Same function but different names with different set of default arguments Paulo da Silva <p_s_d_a_s_i_l_v_a_ns@netcabo.pt> - 2016-01-21 07:30 +0000
  Re: Same function but different names with different set of default arguments Yann Kaiser <kaiser.yann@gmail.com> - 2016-01-21 07:49 +0000
  Re: Same function but different names with different set of default arguments Yann Kaiser <kaiser.yann@gmail.com> - 2016-01-21 08:45 +0000
  Re: Same function but different names with different set of default arguments Peter Otten <__peter__@web.de> - 2016-01-21 10:26 +0100
  Re: Same function but different names with different set of default arguments Steven D'Aprano <steve@pearwood.info> - 2016-01-21 23:24 +1100
  Re: Same function but different names with different set of default arguments Paulo da Silva <p_s_d_a_s_i_l_v_a_ns@netcabo.pt> - 2016-01-23 20:03 +0000

csiph-web