https://www.youtube.com/watch?v=ZDa-Z5JzLYM&list=PL-osiE80TeTsqhIuOqKhwlXsIBIdSeYtc
In this video series on OOP the Python-youtuber Corey Schafer uses instances of his Employee class to store data on employees like their salary and the coding language they know etc. I am rather new to 'higher level' programming and wanted to implement this in one of my projects where I also had to store and subsequently alter the attributes of many similar objects. Soon I realized, however, that it is rather cumbersome to handle the data after the instances have been constructed. For example, how can I iterate over all instances of a certain class or subclass or find instances that have a certain value for a specific attribute? Am I missing something big here or are there really no convenient ways to access the data this way? Finally I ended up using an extra dictionary that stored the instance names and an identifier number to somehow be able to read through the data but then I just could have used a dictionary in the first place. So, is the usage of class instances as data structure like it is displayed in this youtube series just a bad example on how to use classes/instances etc. or is there more to it than the videos show? I have read quite a bit about the topic but still can't figure out why you wouldn't use a dict in the first place or why fundamental built-in functions that would allow to e.g. easily fetch all instances of a subclass are lacking.
Maybe someone can shed some light upon these issues and untangle my confusion. Thanks.