When overriding the .add() method in a subclass, I think the desired behavior of obj.append() would be to call the .add() method of the subclass, right? However, the append method is currently "implemented" as append = add in OrderedSet, which does not lead to a call of .add() in the subclass.
Would the following implementation of the .append() method in OrderedSet maybe resolve the issue?
def append(self, key: T) -> int:
return self.add(key)
When overriding the
.add()method in a subclass, I think the desired behavior ofobj.append()would be to call the.add()method of the subclass, right? However, the append method is currently "implemented" asappend = addinOrderedSet, which does not lead to a call of.add()in the subclass.Would the following implementation of the
.append()method inOrderedSetmaybe resolve the issue?