Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7947309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:23:42+00:00 2026-06-04T01:23:42+00:00

This question is motivated by this this question which I both misread and provided

  • 0

This question is motivated by this
this question which I both misread and
provided a botched answer (I deleted it)

I re-read http://docs.python.org/library/functions.html#id and just tried this in Python:

>>> a = 3
>>> id(a)
5392456

>>> a = 3
>>> id(a)
5392456

repeated a few times more …

The fact that these numbers (ie addresses of the object in memory) are
the same is implementation dependent, and not guaranteed, is that
correct? They could be different, right? My understanding is that each time I do
this simple assignment, I am creating a new object and binding it to a variable
identifier, so I can’t assume that they would be put in the same place
in memory.

Is this understanding correct? If so, are there any exceptions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:23:43+00:00Added an answer on June 4, 2026 at 1:23 am

    You can make that assumption but a times for immutable types like int rather than create a new object, your variable might just reference the immutable object if it already exist. When you do an assignment you are creating a reference to an object. That object might be already around or might be created.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question relates to this question which I asked earlier this week. The answer
I saw this question and it motivated me to look again (without success) at
This question already has an answer here: What are Extension Methods? 5 answers Usage
This question is motivated by something I've lately started to see a bit too
[This question is motivated by Chapter 9 in Real World Haskell] Here's a simple
(Note: this question was motivated by trying to come up with preprocessor hackery to
This question might seem strange but I have been searching for an answer for
This is a general question but motivated by an example. The general question is:
This question is about programming small microcontrollers without an OS. In particular, I'm interested
This question seems to be the essence of several others on this forum. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.