Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'default.': 0.09; 'expectation': 0.09; 'iterate': 0.09; 'keys,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:design': 0.09; 'jan': 0.12; 'dictionaries': 0.16; 'iterating': 0.16; 'iteration': 0.16; 'keys.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:Language': 0.16; 'wrote:': 0.18; 'items.': 0.19; 'preferred': 0.22; 'header:User-Agent:1': 0.23; 'developers': 0.25; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'idea': 0.28; 'factor': 0.31; 'keys': 0.31; 'common': 0.35; 'should': 0.36; 'to:addr:python-list': 0.38; 'issue': 0.38; 'pm,': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'most': 0.60; 'received:173': 0.61; 'more': 0.64; 'forward': 0.65; 'default': 0.69; 'coupled': 0.84; 'received:fios.verizon.net': 0.84; 'items,': 0.91; 'contrary': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Language design Date: Thu, 12 Sep 2013 14:46:21 -0400 References: <522eb795$0$29999$c3e8da3$5496439d@news.astraweb.com> <523206EC.8090404@markusrother.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: <523206EC.8090404@markusrother.de> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1379011598 news.xs4all.nl 15940 [2001:888:2000:d::a6]:57962 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54078 On 9/12/2013 2:24 PM, Markus Rother wrote: > Dictionaries should iterate over their items instead of their keys. Dictionaries *can* iterate by keys, values, or items. You would prefer that the default iteration be by items rather than keys. > Looking forward to contrary opinions. When the issue was discussed and decided, a majority of developers preferred keys. A large factor was experience and expectation that iterating by keys is more common than than iterating by items, coupled with the idea that the most common usage should be the default. -- Terry Jan Reedy