Really, the title says it all. Is there any way to compile all the instances of a class into a list, or other such data structure?
FreezeBlink
0
Light Poster
Recommended Answers
Jump to PostI have done this on occasion. The easiest way to do this is have your __init__() routine append self to a list. If it's not "your" class I suppose you could override the __init__ method of the class.
Fortunately I never had to worry about deletes...
All 4 Replies
BearofNH
104
Posting Whiz
FreezeBlink
0
Light Poster
tenuki
0
Newbie Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.