Python 的id(~)
方法返回對象的"identity"。 "identity" 是一個唯一的整數,在對象的生命周期內是常量,也表示對象在內存中的地址。
參數
1. object
| object
要返回其標識的對象。
返回值
表示給定對象身份的唯一整數。
例子
返回變量 a
的標識:
a = 5.0
id(a)
4384627208
相關用法
- Python id()用法及代碼示例
- Python numpy matrix identity()用法及代碼示例
- Python NumPy identity方法用法及代碼示例
- Python NumPy itemset方法用法及代碼示例
- Python import__用法及代碼示例
- Python isinstance方法用法及代碼示例
- Python BeautifulSoup insert方法用法及代碼示例
- Python itertools.takewhile用法及代碼示例
- Python ipaddress.collapse_addresses用法及代碼示例
- Python ipaddress.IPv4Address.reverse_pointer用法及代碼示例
- Python io.text_encoding用法及代碼示例
- Python string isidentifier()用法及代碼示例
- Python numpy irr用法及代碼示例
- Python ipaddress.IPv4Address.__format__用法及代碼示例
- Python calendar isleap()用法及代碼示例
- Python math isclose()用法及代碼示例
- Python NumPy isalnum方法用法及代碼示例
- Python NumPy isnat方法用法及代碼示例
- Python string isupper()用法及代碼示例
- Python itertools.cycle用法及代碼示例
- Python itertools.dropwhile用法及代碼示例
- Python scipy integrate.trapz用法及代碼示例
- Python itertools.repeat用法及代碼示例
- Python ipaddress.IPv4Network.supernet用法及代碼示例
- Python string isalnum()用法及代碼示例
注:本文由純淨天空篩選整理自Isshin Inada大神的英文原創作品 Python | id method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。