If the same object is invoked multiple times in python, will the memory location always be the same when I print ‘self’?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
AFAIK, memory addresses in Cpython are – by design – static. The memory address of an object can be seen with
id(). The name of the function is a tell-tale of the fact it doesn’t change…See however the comment below, where other SO users pointed out that
id()being the memory address is a detail implementation of Cpython.HTH!