Answer the question
In order to leave comments, you need to log in
Storing a reference to objects?
It is very convenient to store data about objects (when there are a lot of them) using a list.
let's say we need to draw many dots in a tkinter module
point_id = []
while True:
id1 = canvas.create_oval(x,y,x,y, ..........)
point_id.append(id1)
Answer the question
In order to leave comments, you need to log in
1) Seriously, why are object references stored as a number?
2) we constantly create an object with the same name id1, is it really possible? Or is there a link binding?
3) why does an iterator, passing through the list, work with objects, and not with numbers, of which this list consists?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question