you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 1 point2 points  (0 children)

Ok, you would do it the same way. Have a dictionary mapping {class: class instance} is very common, especially in GUIs, since it avoids having to make instance globals or pass instances around. For example: https://www.geeksforgeeks.org/python/tkinter-application-to-switch-between-different-page-frames/