About the changing id of an immutable string

后端 未结 5 1745
暗喜
暗喜 2020-11-22 03:33

Something about the id of objects of type str (in python 2.7) puzzles me. The str type is immutable, so I would expect that once it is

5条回答
  •  有刺的猬
    2020-11-22 04:26

    A more simplified way to understand the behaviour is to check the following Data Types and Variables.

    Section "A String Pecularity" illustrates your question using special characters as example.

提交回复
热议问题