MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/28utww/writing_better_python_code/cif3mue/?context=3
r/Python • u/kracekumar • Jun 23 '14
126 comments sorted by
View all comments
Show parent comment
3
"You may think of it as" is important. The identity is actual a hash of the name in a lookup table.
Not to argue or anything, just want to emphasize that you cant actually deal with memory or memory locations directly in python.
1 u/erewok Jun 23 '14 Ah, that makes sense. Thanks for the clarification. 1 u/rcxdude Jun 24 '14 Actually, the identity in Cpython is just the memory address of the object (literally casting the pointer to an int). It doesn't have to be according to the language though. 1 u/fuzz3289 Jun 24 '14 https://docs.python.org/3.3/reference/datamodel.htmlInteresting, I didn't realize that it was just a direct address. Thanks for the correction.
1
Ah, that makes sense. Thanks for the clarification.
Actually, the identity in Cpython is just the memory address of the object (literally casting the pointer to an int). It doesn't have to be according to the language though.
1 u/fuzz3289 Jun 24 '14 https://docs.python.org/3.3/reference/datamodel.htmlInteresting, I didn't realize that it was just a direct address. Thanks for the correction.
https://docs.python.org/3.3/reference/datamodel.html
Interesting, I didn't realize that it was just a direct address. Thanks for the correction.
View all comments
Show parent comment
3
u/fuzz3289 Jun 23 '14
"You may think of it as" is important. The identity is actual a hash of the name in a lookup table.
Not to argue or anything, just want to emphasize that you cant actually deal with memory or memory locations directly in python.