Sep-19-2019, 04:26 PM
Hello,
I have the following problem:
Why is the instance B updating and how do i prevent that?
Thank you for your help
I have the following problem:
Why is the instance B updating and how do i prevent that?
class myclass(): def __init__(self, x=[]): self.x = x def append_to(self): self.x.append('foo') A=myclass() B=myclass() A.append_to() B.xThis returns ['foo'].
Thank you for your help