要把之前作的兩份研究,整合到另一個專案中
面對的問題大概是這樣子:
記錄一下實作時的想法

class X(object):
def __init__(self, x=set([])):
self.x = x
a = X()
b = X()
print a.x is b.x # True <-- not expected! a.x 和 b.x 指到了同一個 set([])
a.x.add(1)
print a.x # set([1])
print b.x # set([1]) <-- not expected!