Re: Strange object identity problem

2012-11-12 Thread F.R.
On 11/12/2012 06:02 PM, duncan smith wrote: On 12/11/12 13:40, F.R. wrote: 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 [yea

Re: Strange object identity problem

2012-11-12 Thread duncan smith
On 12/11/12 13:40, F.R. wrote: 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 1

Re: Strange object identity problem

2012-11-12 Thread Ulrich Eckhardt
Am 12.11.2012 14:12, schrieb F.R.: Once in a while I write simple routine stuff and spend the next few hours trying to understand why it doesn't behave as I expect. Here is an example holding me up: [...snip incomplete code...] Trying something similar with a simpler class works as expected: [

Re: Strange object identity problem

2012-11-12 Thread F.R.
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.

Re: Strange object identity problem

2012-11-12 Thread Robert Franke
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 = ba

Strange object identity problem

2012-11-12 Thread F.R.
Hi all, Once in a while I write simple routine stuff and spend the next few hours trying to understand why it doesn't behave as I expect. Here is an example holding me up: I have a module "st" with a class "runs". In a loop I repeatedly create an object "ba" and call the method "ba.run ()" whic