Re: Class data being zapped by method

2006-08-09 Thread John Machin
Kevin M wrote: > Good news. I've fixed it up and all seems to be well. > > Thanks, all. I've learned a lot from this -:) Kindly share the learning by feeding back: (1) What the original problem ("class data being zapped by method") really was. (2) What was the caus

Re: Class data being zapped by method

2006-08-09 Thread Kevin M
Good news. I've fixed it up and all seems to be well. Thanks, all. I've learned a lot from this :) John Machin wrote: > Kevin M wrote: > > Inline > > > > > 1.) Why are you removing the .pyc file? > > > > After I had run the script once and subsequently changed the class > > file, I would run the

Re: Class data being zapped by method

2006-08-09 Thread Bruno Desthuilliers
Sion Arrowsmith wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >> fpath = os.path.join('datafiles', filename + ".tabdata") > > fpath = os.path.join('datafiles', filename + os.path.extsep + "tabdata") > 8-) I'm a bit bemused by extsep -- it didn't appear until 2.2, by > which time there

Re: Class data being zapped by method

2006-08-09 Thread Sion Arrowsmith
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >fpath = os.path.join('datafiles', filename + ".tabdata") fpath = os.path.join('datafiles', filename + os.path.extsep + "tabdata") 8-) I'm a bit bemused by extsep -- it didn't appear until 2.2, by which time there can't have been many people with an

Re: Class data being zapped by method

2006-08-09 Thread Bruno Desthuilliers
Simon Forman wrote: (snip) > Not that this has anything to do with your actual question, but there > are a number of small details that I noticed while reading your code: > > > 2.) Reading lines from a file is better done like so: > > arrLines = open('datafiles/'+filename+'.tabdata').readlines()

Re: Class data being zapped by method

2006-08-08 Thread John Machin
Kevin M wrote: > Inline > > > 1.) Why are you removing the .pyc file? > > After I had run the script once and subsequently changed the class > file, I would run the script again, and it would use the pyc file from > the older revision of the script. I got frustrated with having to > manually delet

Re: Class data being zapped by method

2006-08-08 Thread Kevin M
Inline > 1.) Why are you removing the .pyc file? After I had run the script once and subsequently changed the class file, I would run the script again, and it would use the pyc file from the older revision of the script. I got frustrated with having to manually delete the pyc file before rerunnin

Re: Class data being zapped by method

2006-08-08 Thread John Machin
John Machin wrote: > print [i, len(x.data), id(x) for i, x in enumerate(arrTests)] but should have written: print [(i, len(x.data), id(x)) for i, x in enumerate(arrTests)] -- http://mail.python.org/mailman/listinfo/python-list

Re: Class data being zapped by method

2006-08-08 Thread Simon Forman
Kevin M wrote: > Figures. I'll try to complicate it sufficiently ;) > > > [edit] I was going to try to sum up what goes on, but I realized that I > was retyping what I already programmed in an effort to better > illustrate exactly what I'm doing. Pastebin it is. Don't fear, it's > only around 200 l

Re: Class data being zapped by method

2006-08-08 Thread John Machin
Kevin M wrote: > Figures. I'll try to complicate it sufficiently ;) > > > [edit] I was going to try to sum up what goes on, but I realized that I > was retyping what I already programmed in an effort to better > illustrate exactly what I'm doing. Pastebin it is. Don't fear, it's > only around 200 l

Re: Class data being zapped by method

2006-08-08 Thread Kevin M
Figures. I'll try to complicate it sufficiently ;) [edit] I was going to try to sum up what goes on, but I realized that I was retyping what I already programmed in an effort to better illustrate exactly what I'm doing. Pastebin it is. Don't fear, it's only around 200 lines total. Class file --

Re: Class data being zapped by method

2006-08-08 Thread Gary Herron
[EMAIL PROTECTED] wrote: > Hi, > > I'll cut to the chase. > > I have a class named Foo(). I create an instance of this class named > bar, and I set bar.data to a large list of tuples. > > Within Foo() there is a method which operates on self.data. I need to > call this method after I set self.data

Class data being zapped by method

2006-08-08 Thread arenium
Hi, I'll cut to the chase. I have a class named Foo(). I create an instance of this class named bar, and I set bar.data to a large list of tuples. Within Foo() there is a method which operates on self.data. I need to call this method after I set self.data from the "outside" (bar.data), which isn