fork(1) download
  1. class Foo:
  2. def __init__(self, values = []):
  3. self.values = values
  4.  
  5. a = Foo()
  6. b = Foo()
  7.  
  8. a.values.append(1)
  9.  
  10. print(b.values) # [1]
  11.  
  12. print("a", id(a.values))
  13. print("b", id(b.values))
Success #stdin #stdout 0.02s 27760KB
stdin
Standard input is empty
stdout
[1]
a 47568867296648
b 47568867296648