Yes, it's right. In most cases, just think of value as the object itself.
You can also use the word “state” to describe the value of an object; for mutable objects, the value can change, but in general, the object, type and identifier do not change.
Some examples:
2048- this is intwith an integer value of 2048. intis an immutable type, so the value will never change. Usually you create a new object of the same type with a different value; 2048 + 1creates a new object intwith a value of 2049 with a new identifier.[42]is a list with a single reference to another object. You can change the content by changing the value of the list. But personality and type would not change.- For class instances, Python
__class__is writable, allowing you to dynamically change the type. This is rarely necessary, but an option exists.
source
share