python bug?

Anthony Petropoulos apetrop at
Mon Jul 26 15:21:51 CEST 2004


When running this simple code:
class Dada:
        a = []
        def __init__(self, arg):

d1 = Dada("pro")
d2 = Dada("hoho")

print d1.a, d2.a
I get the output ['pro', 'hoho'] ['pro', 'hoho'], instead of what I
expected: ['pro'] ['hoho'].

Is this a feature? Is there something I'm missing?

Anthony Petropoulos

More information about the Python-list mailing list