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.
For a bit more context, the objects of the first class I am working with are options (in the context of finance) and I want the objects of the new class to be portfolios of options.