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


Groups > comp.lang.python > #2994

Re: [Feature Request] dict.setdefault()

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!news-transit.tcx.org.uk!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <anikom15@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.027
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'subject:: [': 0.03; 'args': 0.07; 'defaults': 0.07; 'subject:()': 0.09; 'wrote:': 0.14; 'blah': 0.16; 'rantingrick': 0.16; 'settle': 0.16; 'subject:] ': 0.16; 'subject:skip:d 10': 0.18; 'header:In-Reply- To:1': 0.22; 'mon,': 0.22; 'smart': 0.23; 'ps:': 0.25; 'list': 0.30; 'to:addr:python-list': 0.32; 'someone': 0.33; 'from:charset:iso-8859-1': 0.33; 'received:192.168.1': 0.34; 'received:192': 0.34; '-0700,': 0.35; 'received:192.168': 0.37; 'some': 0.37; 'case': 0.37; 'should': 0.37; 'received:209.85': 0.37; 'received:google.com': 0.38; 'but': 0.38; 'anything': 0.38; 'to.': 0.39; 'under': 0.39; 'set': 0.39; 'likely': 0.39; 'to:addr:python.org': 0.39; 'could': 0.39; 'received:209': 0.39; 'header:Mime-Version:1': 0.39; 'would': 0.40; 'header:Received:5': 0.40; 'needing': 0.68; 'received:209.85.216.181': 0.68; 'received :mail-qy0-f181.google.com': 0.68; 'subject:Request': 0.73; 'message-id:@localhost.localdomain': 0.74
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:in-reply-to:references :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=RnQz7FkNDvSp8SDrQz1FSUWn0sUOIt5yFeXFVyejeOs=; b=f40UJfa4+MG0cQjMNobBxgENs2VT7ZskdoQX2+57i5xMWdA+1q+ETQFUM8QUqUUsIt 1f5PPkzb7ohWWrMJ20sIR5TA2ov83qSGLgZ6ecvqbOajRk3W2FSo4YxdsliJFspYW3AI fDJnszgdobzCFHud4sxmKQeBM9HBFgYunyxQ0=
DomainKey-Signature a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=W/SbHY19e8rvY3S9L2ZYa1/9DOOE8LmkDhe6JI+istMng+LmivwlFpxfllHgMN+GCH +ZbRQQO+RumVvmCGPqOJvR/9RGD4Bww28KeKWvDy7CW9Y/9Rs/1UjgZnLVPmpo1ETPkE YTTqp+8LMVJoipvKamVMajxIe6RJSJszhnfRI=
Subject Re: [Feature Request] dict.setdefault()
From Westley Martínez <anikom15@gmail.com>
To python-list@python.org
In-Reply-To <48897e75-c02c-43c7-9f46-39da4bcc406d@p16g2000vbi.googlegroups.com>
References <48897e75-c02c-43c7-9f46-39da4bcc406d@p16g2000vbi.googlegroups.com>
Content-Type text/plain; charset="UTF-8"
Date Mon, 11 Apr 2011 15:16:47 -0700
Mime-Version 1.0
X-Mailer Evolution 2.32.2
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.224.1302560215.9059.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 82.94.164.166
X-Trace 1302560215 news.xs4all.nl 32470 [::ffff:82.94.164.166]:56506
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:2994

Show key headers only | View raw


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.setdefault(blah, blah)
> d.setdefault(blah, blah)
> if blah is not blah:
>     d.setdefault(blah, blah)
> 
> ...nuff said.
> 
> PS: And to counter the very *extemely* likely chance of some smart
> arse responses
>   * YES, i know i could create my own setdefault method but that is
> not the point.
>   * I know we are under the moratorium but someone had to mention it,
> 
> --rr

Go to bugs.python.org

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


Thread

[Feature Request] dict.setdefault() rantingrick <rantingrick@gmail.com> - 2011-04-11 14:35 -0700
  Re: [Feature Request] dict.setdefault() Westley Martínez <anikom15@gmail.com> - 2011-04-11 15:16 -0700
  Re: [Feature Request] dict.setdefault() MRAB <python@mrabarnett.plus.com> - 2011-04-11 23:41 +0100
    Re: dict.setdefault() rantingrick <rantingrick@gmail.com> - 2011-04-11 19:58 -0700
      Re: dict.setdefault() Westley Martínez <anikom15@gmail.com> - 2011-04-12 07:02 -0700
  Re: [Feature Request] dict.setdefault() Chris Angelico <rosuav@gmail.com> - 2011-04-12 08:44 +1000
  Re: dict.setdefault() Raymond Hettinger <python@rcn.com> - 2011-04-11 15:49 -0700
  Re: [Feature Request] dict.setdefault() Chris Rebert <clp2@rebertia.com> - 2011-04-11 15:53 -0700
  Re: [Feature Request] dict.setdefault() MRAB <python@mrabarnett.plus.com> - 2011-04-11 23:59 +0100
  Re: [Feature Request] dict.setdefault() Tim Chase <python.list@tim.thechases.com> - 2011-04-11 18:25 -0500
    Re: dict.setdefault() Raymond Hettinger <python@rcn.com> - 2011-04-11 17:17 -0700

csiph-web