Help! This is driving me insane!

Mark McEahern marklists at mceahern.com
Fri Sep 27 02:40:03 CEST 2002


[kara.klosterman]
> I created a very simple class that totals some data
> but I am not getting the output from it that I would
> expect at all.
> Here is the class:
> http://www.geocities.com/dbasch/insane.txt
>
> I would expect to get:
> [0, 0]
> [0, 0]
> [[0, 0]]
>
> but I am getting:
> [0, 0]
> [0, 0]
> [[1, 1]]
>
> I dont understand how the 'grouptotals' list is
> getting the incremented values prior to the
> 'grouptotalcounter' function being called.
> furthermore, I can place a 'print grouptotals' right
> after the errorlog append and it isnt the incremented
> values! Please tell me this isnt a normal thing!

I glanced at your code and tried to decipher it.  My overall reaction is
that the intention behind your code is obscure to me.  Note that you don't
even really tell us how to run it and how you got your output.  I'm guessing
you did this:

  t = Test()
  x = t.run()
  print x

// m





More information about the Python-list mailing list