Here is a python class:
class TxdTest(object):
def __init__(self, name = '', atrributes = []):
self.name = name
self.attributes = atrributes
and then I use it like this:
def main():
for i in range(3):
test = TxdTest()
print test.name
print test.attributes
test.name = 'a'
test.attributes.append(1)
so, what's the result? The result is:
[]
[1]
[1, 1]
Why the 'self.attributes' in class still obtain the value ?