How do I call the Python id function from Rust? #2878
-
In my specific case, I have an instance of |
Beta Was this translation helpful? Give feedback.
Answered by
birkenfeld
Jan 13, 2023
Replies: 1 comment 9 replies
-
Since the Otherwise, you can get at |
Beta Was this translation helpful? Give feedback.
9 replies
Answer selected by
LilyAcorn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since the
id
is simply the object's memory address, you can useobj.as_ptr()
from theAsPyPointer
trait.Otherwise, you can get at
id
(or other built-in functions) usingpy.eval("id", None, None)
.