Relative Content

Tag Archive for pythonclassoopsubclassfinance

Making a class whose objects are collections of objects from another class in python

I have a class MyClass and want to create another class consisting of lists of objects from MyClass. Would subclasses be suitable for this or a new class entirely? My current understanding of subclasses is that they are for specific types of objects from the original class, but can they be used in this way? I will need to access the methods and attributes of the elements of the objects in the second class when working with the second class.