On 4/11/22 1:29 am, Julieta Shem wrote:
Perhaps I can reduce the class Pair to just being a pair as we know it, made of two things, then we create a class called Sequence, which is really a composition of Pairs, comes with a length method and we derive Stack from it.
That sounds better. But be careful -- a Sequence class would probably be expected to have methods for e.g. inserting and removing things in the middle, which you might not want to allow for a Stack. -- Greg -- https://mail.python.org/mailman/listinfo/python-list