我已经在python中定义了一个类对象。但是,instance属性之一是引用另一个类的实例。我的问题是,实例的属性可变吗?类对象是不可变的?
## This is the class object:
class node(object):
def __init__(self,data=None):
self.data = data
self.next =None
## I have the following code
current = node(1)
current.next = node(2)
previous = node(11)
next_1 = current.next
current.next = previous
## if current.next is mutable, once I reset current.next to be equal to previous, the value of next_1 will be changed