Skip to content

Python 内存管理

id( )

该内置函数用于查看数据的内存地址,返回值为一个数值

py
id(数据)

print(type(id(数据)))  # <class 'int'>