Re: Two instances share an attribute

2008-11-15 Thread Filip Gruszczyński
Every day something new. Thanks a lot :) 2008/11/15 Cameron Simpson <[EMAIL PROTECTED]>: > On 15Nov2008 22:41, Filip Gruszczyński <[EMAIL PROTECTED]> wrote: > | I really don't understand, what's happening with the following code. > | Am I doing something wrong? > > Yes. This is a common mistake: >

Re: Two instances share an attribute

2008-11-15 Thread Cameron Simpson
On 15Nov2008 22:41, Filip Gruszczyński <[EMAIL PROTECTED]> wrote: | I really don't understand, what's happening with the following code. | Am I doing something wrong? Yes. This is a common mistake: | class EnumeratedContent: | def __init__(self, values = []): | self.values

Two instances share an attribute

2008-11-15 Thread Filip Gruszczyński
I really don't understand, what's happening with the following code. Am I doing something wrong? #!/usr/bin/python class EnumeratedContent: def __init__(self, values = []): self.values_ = values def values(self): return self.values_ def a