J
Johnny Lee
Hi,
Look at the follow command in python command line, See what's
interesting?
1 0
---------------------------------------
def __init__(self):
self.arr = []['haha'] []
Look at the follow command in python command line, See what's
interesting?
1 0
---------------------------------------
[/QUOTE]['haha']class A: arr = []
a = A()
b = A()
aa.arr.append("haha")
print a.arr , b.arr ['haha'] ['haha']
a.arr = ["xixi"]
print a.arr , b.arr ['xixi'] ['haha']
A.arr ['haha']
A.arr.append("xx")
A.arr ['haha', 'xx']
a.arr ['xixi']
b.arr ['haha', 'xx']
b.arr.pop() 'xx'
b.arr ['haha']
A.arr
def __init__(self):
self.arr = []['haha'] []