On 04/11/2011 05:44 PM, Chris Angelico wrote:
On Tue, Apr 12, 2011 at 8:41 AM, MRAB wrote:
I'm not sure that "setdefault" should take **kw args for this because
of its existing argument structure (key + optional value).
A new method like "updatedefault" may be better, IMHO. It would act
like "
On 11/04/2011 23:44, Chris Angelico wrote:
On Tue, Apr 12, 2011 at 8:41 AM, MRAB wrote:
I'm not sure that "setdefault" should take **kw args for this because
of its existing argument structure (key + optional value).
A new method like "updatedefault" may be better, IMHO. It would act
like "upd
On Mon, Apr 11, 2011 at 2:35 PM, rantingrick wrote:
>
> setdefault should take **kw args in the case of needing to set
> multiple defaults at one time. I would even settle for an *arg list if
> i had to.
What would the return value be? dict.setdefault() doesn't currently
just return None you know
On Tue, Apr 12, 2011 at 8:41 AM, MRAB wrote:
> I'm not sure that "setdefault" should take **kw args for this because
> of its existing argument structure (key + optional value).
>
> A new method like "updatedefault" may be better, IMHO. It would act
> like "update" except that it wouldn't overwrit
On 11/04/2011 23:16, Westley MartÃnez wrote:
On Mon, 2011-04-11 at 14:35 -0700, rantingrick wrote:
setdefault should take **kw args in the case of needing to set
multiple defaults at one time. I would even settle for an *arg list if
i had to. Anything is better than...
d.setdefault(blah, blah)
On Mon, 2011-04-11 at 14:35 -0700, rantingrick wrote:
> setdefault should take **kw args in the case of needing to set
> multiple defaults at one time. I would even settle for an *arg list if
> i had to. Anything is better than...
>
> d.setdefault(blah, blah)
> d.setdefault(blah, blah)
> d.setdefa
setdefault should take **kw args in the case of needing to set
multiple defaults at one time. I would even settle for an *arg list if
i had to. Anything is better than...
d.setdefault(blah, blah)
d.setdefault(blah, blah)
d.setdefault(blah, blah)
d.setdefault(blah, blah)
if blah is not blah:
d