Immutable vs Mutable types

前端 未结 16 1717
感情败类
感情败类 2020-11-21 05:51

I\'m confused on what an immutable type is. I know the float object is considered to be immutable, with this type of example from my book:

class         


        
16条回答
  •  自闭症患者
    2020-11-21 06:34

    One way of thinking of the difference:

    Assignments to immutable objects in python can be thought of as deep copies, whereas assignments to mutable objects are shallow

提交回复
热议问题