In simple terms, what I want is a tuple with one or two additional methods. __new__ or __init__ will not be changed.
I would like to create an abstract base class that is a subclass of collections.abc.Sequence . Then I want to use it for the main tuple subclass. The class diagram looks something like this:
collections.abc.Sequence / \ / \ / \ MyABC tuple \ / \ / \ / MyClass
Causes:
MyABC defines some user interfaces. It is there that third parties are not forced to subclass MyClass .tuple needed for its performance and methods already implemented.
Questions:
- Is it an idiomatic way to just write
class MyClass(MyABC, tuple) or should I play with registers? - Are there any other obvious issues that I'm missing?
- Will
tuple lose space and performance due to subclass?
source share