Python built-in function id

高洛峰
Release: 2016-11-02 14:22:11
Original
1518 people have browsed it

English documentation:

id(object)


Return the “identity” of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the sameid() value.

CPython implementation detail: This is the address of the object in memory.


Description:

   1. Return the unique identifier of the object, expressed as an integer. This identifier constant is unique during the lifetime of the program.

>>> a = 1
>>> id(a)
>>> id(1.0)
>>> a = 'some text'
>>> id(a)
Copy after login


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template