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


Groups > comp.lang.python > #33180 > unrolled thread

Re: Strange object identity problem

Started byRobert Franke <franke.rob@gmail.com>
First post2012-11-12 14:27 +0100
Last post2012-11-12 14:27 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Strange object identity problem Robert Franke <franke.rob@gmail.com> - 2012-11-12 14:27 +0100

#33180 — Re: Strange object identity problem

FromRobert Franke <franke.rob@gmail.com>
Date2012-11-12 14:27 +0100
SubjectRe: Strange object identity problem
Message-ID<mailman.3585.1352726872.27098.python-list@python.org>
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]?


>     print y, id (b)
>
> 2010 149727788
> 2011 149727788
> 2012 149727788
>
[...]

Cheers,

Robert

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web