Immutable view classes - inherit from dict or from Mapping?

Hi, I have written some classes that represent immutable views on collections (see "immutable-views" package on Pypi). Currently, these view classes inherit from the abstract collection classes such as Mapping, Sequence, Set. However, they implement the read-only methods of dict, list and set, which provides some more methods compared to the abstract collection classes. For example, class "dict" provides copy() or __reversed__() and the newer OR-operator methods all of which are not defined on the abstract class "Mapping". Note that the view classes do not provide any of the modifying methods of "dict" and "list", because after all the views are supposed to be immutable. My question is, should the dict view class inherit from Mapping or from dict, and likewise, should the list view class inherit from Sequence or from list?

On 4/12/2021 11:29 AM, Andreas R Maier wrote:
I have written ... My question is, should ...
The pydev list is for development of future Python versions and CPython releases. Questions about the use of, or development with, current versions and releases should be directed elsewhere, such as python-list or stackoverflow. -- Terry Jan Reedy

On 4/12/2021 11:29 AM, Andreas R Maier wrote:
I have written ... My question is, should ...
The pydev list is for development of future Python versions and CPython releases. Questions about the use of, or development with, current versions and releases should be directed elsewhere, such as python-list or stackoverflow. -- Terry Jan Reedy
participants (2)
-
Andreas R Maier
-
Terry Reedy