hug2wisdom / learnpython

note the points of learn python
0 stars 0 forks source link

immutable 永远不变的 #3

Open hug2wisdom opened 4 years ago

hug2wisdom commented 4 years ago

immutable An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to be created if a different value has to be stored. They play an important role in places where a constant hash value is needed, for example as a key in a dictionary.

hug2wisdom commented 4 years ago

sequence types (such as list, str, and tuple and bytes)