What is the id( ) function used for?

前端 未结 13 1235
傲寒
傲寒 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 10:59

    I have an idea to use value of id() in logging.
    It's cheap to get and it's quite short.
    In my case I use tornado and id() would like to have an anchor to group messages scattered and mixed over file by web socket.

提交回复
热议问题