Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed6.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'space.': 0.07; 'restarted': 0.09; 'clash': 0.16; 'idle.': 0.16; 'paused': 0.16; 'received:195.186': 0.16; 'received:bluewin.ch': 0.16; 'subject:object': 0.16; 'wrote:': 0.17; "shouldn't": 0.17; '(b)': 0.22; 'exists.': 0.22; 'subject:problem': 0.22; 'cheers,': 0.23; 'somewhere': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'reflect': 0.27; 'that.': 0.30; 'year,': 0.30; 'more,': 0.32; 'print': 0.32; 'problem': 0.33; 'to:addr:python- list': 0.33; 'thanks': 0.34; 'robert': 0.35; 'pm,': 0.35; 'there': 0.35; 'should': 0.36; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'range': 0.60; 'received:ch': 0.69 Date: Mon, 12 Nov 2012 14:40:59 +0100 From: "F.R." User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Strange object identity problem References: <50A0F5A8.4080802@bluewin.ch> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352727727 news.xs4all.nl 6947 [2001:888:2000:d::a6]:42102 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33181 On 11/12/2012 02:27 PM, Robert Franke wrote: > Hi Frederic, > > [...] > >>>>> bas = {} >>>>> for year in range (2010, 2013): >> ba = st.runs ('BA', '%d-01-01' % year, '%d-12-31' % year) >> ba.run () >> print year, id (ba) >> bas [year] = ba >> >> 2010 150289932 >> 2011 150835852 >> 2012 149727788 >> >>>>> for y in sorted (bas.keys ()): >> b = bas [year] > Shouldn't that be b = bas[y]? Yes, it should, indeed! What's more, I should have closed and restarted IDLE. There must have been a name clash somewhere in the name space. The problem no longer exists. Sorry about that. And thanks to all who paused to reflect on this non-problem. - Frederic. > > >> print y, id (b) >> >> 2010 149727788 >> 2011 149727788 >> 2012 149727788 >> > [...] > > Cheers, > > Robert >