Why does SortedList not have a constructor?


#1

Question

In this exercise, the SortedList class has no constructor. Why does it not need one?

Answer

The SortedList class inherits from the Python list class. The list class provides the implementation to store data. The SortedList class doesn’t need to change the storage of data only the way that the data is added, so SortedList objects will use the constructor from the parent list class and only provide an implementation for the append() method.