Python 内建函数 - id(object)
2017-03-16 09:50
375 查看
Manual
直译
实例
CPython implementation detail: This is the address of the object in memory.
CPython实现细节:该值为对象的内存地址。
直译
实例
Manual
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 same id() value.CPython implementation detail: This is the address of the object in memory.
直译
返回object的“身份”,返回值为整数,是为了确保在对象的生命周期内的独特性和一致性,两个非重叠生命周期的对象可能有相同的id()值。CPython实现细节:该值为对象的内存地址。
实例
>>> import os >>> id(os) 44484096 >>> def foo(x): print('Hello world! Hello ', x) >>> id(foo) 58350808 >>> id(foo('Logan')) Hello world! Hello Logan 1568099016 # 注意id的变化
相关文章推荐
- SQL中object_id函数的用法
- 解密python的id()函数
- Python标准库:内置函数id(object)
- python根据时间生成mongodb的ObjectId的方法
- SQL中object_id函数的用法
- SQL中object_id函数的用法
- python优化 id()函数
- Sqlserver 中系统表sysobjects、syscolumns以及函数object_id
- Python中的id函数到底是什么?
- python将MongoDB里的ObjectId转换为时间戳的方法
- python的id()函数解密过程
- python内建函数hasattr(object, name)
- python的id()函数介绍
- Python id() 函数
- SQL Server OBJECT_ID() 函数
- SQL中object_id函数的用法
- python的id()函数介绍
- python的id函数
- 【转】Python 里的 super() 函数和 object.__new__ ()、.__del__() 方法
- SQL中object_id函数的用法