Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!news.wiretrip.org!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.03; 'args': 0.07; 'imho.': 0.09; 'overwrite': 0.09; 'subject:()': 0.09; 'am,': 0.14; 'wrote:': 0.14; '(key': 0.16; 'mrab': 0.16; 'argument': 0.16; 'subject:] ': 0.16; 'subject:skip:d 10': 0.18; "wouldn't": 0.18; 'tue,': 0.20; 'header:In-Reply-To:1': 0.22; 'optional': 0.23; 'values.': 0.23; 'structure': 0.24; "i'm": 0.26; 'chris': 0.27; 'message-id:@mail.gmail.com': 0.28; 'to:addr :python-list': 0.32; 'skip:" 10': 0.34; 'should': 0.37; 'received:209.85': 0.37; 'apr': 0.38; 'received:google.com': 0.38; 'pretty': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'except': 0.39; 'would': 0.40; 'header:Received:5': 0.40; 'act': 0.61; '2011': 0.62; 'subject:Request': 0.73; 'received:209.85.210.174': 0.84; 'received:mail- iy0-f174.google.com': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=+nijsm5zpLBtyD7T81MSijVAKtwzBN+6cDt83wMQErc=; b=M4nuYy4qDwujBU9cfOy1G6wRQEmixLo/VgHxdurMK6+4Q9hexl86fNPlCghBcKkT66 UV5br04PNuZfkq6LImMChQtgYBJYk4u8AYZSu/Twe8cW19r7fJfemHywXIt14lk9A2Eh f44I1fOH2PiiZwqjkHRaW1496YJ62JkvWEUP8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ihpAOKv/4MGSym+QcyA7dKJuLdk0nc3R4oNKNOTHu5zfEMM5Z4/9wU4TTPeaIl50vF 9WBg117Jw359Ba3j69mhiQ7WbmKg7w4CFSe70nWIcYbhtb2XmDVyCfCZnMS3/btzcA5D 3GwQOts9zFEIqk8cps/cmJuCQGJHiqM9eucfc= MIME-Version: 1.0 In-Reply-To: <4DA38391.1040507@mrabarnett.plus.com> References: <48897e75-c02c-43c7-9f46-39da4bcc406d@p16g2000vbi.googlegroups.com> <1302560207.11756.1.camel@localhost.localdomain> <4DA38391.1040507@mrabarnett.plus.com> Date: Tue, 12 Apr 2011 08:44:53 +1000 Subject: Re: [Feature Request] dict.setdefault() From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 10 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1302561897 news.xs4all.nl 81475 [::ffff:82.94.164.166]:48187 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2997 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 overwrite existing values. Wouldn't x.updatedefault(y) be pretty much y.update(x) ? Chris Angelico