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?