What is the id( ) function used for?

前端 未结 13 1234
傲寒
傲寒 2020-11-22 10:51

I read the Python 2 docs and noticed the id() function:

Return the “identity” of an object. This is an integer (or long integer) which is

13条回答
  •  无人共我
    2020-11-22 11:07

    The answer is pretty much never. IDs are mainly used internally to Python.

    The average Python programmer will probably never need to use id() in their code.

提交回复
热议问题