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 8984955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:13:48+00:00 2026-06-15T21:13:48+00:00

Theory question Every Python shell has objects that can be used without being declared

  • 0

Theory question

Every Python shell has objects that can be used without being declared or created, such as True, False, “”, [], {}, and any combination of integers and floating point numbers.

This means that at any point, you can get their ids.

id(1)
id(42)
id('')

etc.

Of course, if you try to get the id of an undeclared object, you get:

id(myobject1)

Traceback (most recent call last):
  File "<pyshell#29>", line 1, in <module>
    id(myobject1)
NameError: name 'myobject1' is not defined

Since myobject1 points to nothing, it’s not defined, and has no id.

Yet, there are an infinite number of objects which could be used without declaration, because the number system is infinite. Thus it would be impossible for all of the undeclared objects to have id’s prior to being used in some capacity in the program.

When do these objects get assigned ids?

  • 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-15T21:13:50+00:00Added an answer on June 15, 2026 at 9:13 pm

    You are misunderstanding the concept of assignment.

    On an assignment, you bind a object to a name. All names which are assigned to can be used in any way that is wanted, unassigned names don’t exist and thus cannot point to anything (including “nowhere”).

    With id(spam) you ask for the object which spampoints to and then ask for its ID.

    A non-existing name spam has no object assigned to it whose ID could be queried.

    OTOH, every object has an ID.

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

Sidebar

Related Questions

This is more of a cryptography theory question, but is it possible that the
This is a simple question from algorithms theory. The difference between them is that
Simply question of theory When building a class that is not going to be
I am sorry if this is more of a theory question then a real
I've just imported a Flex component into my project. I have a theory question
I have this question, just in theory. I do some query results and there
I have question about clean thory in Python. When: @decorator_func def func(bla, alba): pass
In theory in layered architecture you can have multiple modules on the same layer.
This is a theoretical question, so expect that many details here are not computable
This is a very simple task in every language I have ever used, but

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.