'Mutable types in python

Of the basic types of python, which of those are mutable? From reviewing the docs it looks like:

  • list
  • set (though not frozenset)
  • dict

Are the only mutable types, and everything else is immutable, but I wasn't able to find a definitive list on this. Is the above correct, or am I missing any python types that are mutable?



Solution 1:[1]

  1. Some of the mutable data types in Python are list, dictionary, set and user-defined classes.

  2. On the other hand, some of the immutable data types are int, float, decimal, bool, string, tuple, and range.

https://towardsdatascience.com/https-towardsdatascience-com-python-basics-mutable-vs-immutable-objects-829a0cb1530a[Source][1]

Solution 2:[2]

Take a look to this page in documentation. Here you can find all information about mutability of most common types in Python.

P. S. It is rather comment than answer, but my reputation is too small to comment.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 eyllanesc
Solution 2