>>> a=(1,2,3,4) >>> a+=(5,6,7) >>> print(a) >>> a=[1,2,3,4] >>> a+=[5,6,7] >>> print( a ) >>> a=(1,2,3,4) >>> print(id(a)) >>> a+=(5,6,7) >>> print(id(a)) >>> a=[1,2,3,4] >>> print(id(a)) >>> a+=[5,6,7] >>> print(id(a)) >>> a=(1,2,3,4) >>> a=a+(5,6,7) >>> a=[1,2,3,4] >>> a.extend([5,6,7]) class PointMutable(object): def __init__(self, x, y): self.x=x self.y=y def __repr__(self): return ""%(self.x,self.y) def __sub__(self, other): self.x-=other.x self.y-=other.y return self def __add__(self, other): self.x+=other.x self.y+=other.y return self def move(self, dx, dy): self.x+=dx self.y+=dy return self >>> p1=PointMutable(1,1) >>> p2=PointMutable(-1,1) >>> print p1.move(1,1) - (p1+p2).move(2,2) class PointInmutable(object): def __init__(self, x, y): self.x=x self.y=y def __repr__(self): return ""%(self.x,self.y) def __sub__(self, other): return PointInmutable(self.x-other.x,self.y-other.y) def __add__(self, other): return PointInmutable(self.x+other.x,self.y+other.y) def move(self, dx, dy): return PointInmutable(self.x+dx,self.y+dy) >>> p1=PointInmutable(1,1) >>> p2=PointInmutable(-1,1) >>> print p1.move(1,1) - (p1+p2).move(2,2)