Re: problem manipulating a list belonging to a class

2009-11-23 Thread Marc Leconte
Thx all, good to know :) Le dimanche 22 novembre 2009 à 15:16 -0800, Steve Howell a écrit : > On Nov 22, 3:14 pm, Steve Howell wrote: > > > Explanations of why you need to write it that will follow... > > I knew this had to be written up somewhere... > > http://www.ferg.org/projects/python_got

Re: problem manipulating a list belonging to a class

2009-11-23 Thread Terry Reedy
Marc Leconte wrote: Dear all, I have a problem with the following code (ubuntu 8.04, Python 2.5.2): class Toto(object): def __init__(self, number, mylist=[]): self.number=number self.mylist=mylist pass pass listA=Toto(number=1) li

Re: problem manipulating a list belonging to a class

2009-11-22 Thread Lie Ryan
Marc Leconte wrote: class Toto(object): def __init__(self, number, mylist=[]): self.number=number self.mylist=mylist pass pass Why are you using pass to end your blocks? -- http://mail.python.org/mailman/listinfo/python-list

Re: problem manipulating a list belonging to a class

2009-11-22 Thread Steve Howell
On Nov 22, 3:14 pm, Steve Howell wrote: > Explanations of why you need to write it that will follow... I knew this had to be written up somewhere... http://www.ferg.org/projects/python_gotchas.html#contents_item_6 -- http://mail.python.org/mailman/listinfo/python-list

Re: problem manipulating a list belonging to a class

2009-11-22 Thread Steve Howell
On Nov 22, 2:50 pm, Marc Leconte wrote: > Dear all, > > I have a problem with the following code (ubuntu 8.04, Python 2.5.2): > > class Toto(object): >         def __init__(self, number, mylist=[]) >                 self.number=number >                 self.mylist=mylist >                 pass >  

Re: problem manipulating a list belonging to a class

2009-11-22 Thread Diez B. Roggisch
Marc Leconte schrieb: Dear all, I have a problem with the following code (ubuntu 8.04, Python 2.5.2): class Toto(object): def __init__(self, number, mylist=[]): self.number=number self.mylist=mylist pass pass listA=Toto(number=1)

problem manipulating a list belonging to a class

2009-11-22 Thread Marc Leconte
Dear all, I have a problem with the following code (ubuntu 8.04, Python 2.5.2): class Toto(object): def __init__(self, number, mylist=[]): self.number=number self.mylist=mylist pass pass listA=Toto(number=1) listB=Toto(number=2) li