[Tutor] beginner: using optional agument in __init__ breaks my code

2006-06-25 Thread Barbara Schneider
Hello Group, I am puzzled about this: The following code implements a simple FIFO object. class Queue: "Implementing a FIFO data structure." # Methods def __init__(self): self.queue = [] def emptyP(self): return (self.queue == []) def insert(self, item):

Re: [Tutor] beginner: using optional agument in __init__ breaks my code

2006-06-25 Thread Barbara Schneider
--- Karl Pflästerer <[EMAIL PROTECTED]> schrieb: > > The values of optional arguments are only once > evaluated (when Python > reads the definition). If you place there mutable > objects like e.g. a > list most of the time the effect you see is not what > you want. So you > have to write it a bi