On Sat, Feb 22, 2020 at 4:45 PM Brandt Bucher <brandtbucher@gmail.com> wrote:
[quoting Nick]
> collections.Mapping and collections.MutableMapping could provide concrete method implementations that make subclasses behave in a way that's similar to built-in dicts

Hm, haven't thought too much about this (I don't have much experience with the ABCs). Would they return dicts, or call the self.copy and self.update methods?

Those are just hypothetical questions for now; I don't necessarily want to dig too far into that discussion again. But I agree that it's definitely worth considering. ;)

Mapping and MutableMapping don't have copy() methods -- these are intentionally narrower interfaces than dict. I think we should leave them alone. The PEP does *not* propose to add `|` to Mapping, and that's intentional. Because of this I think we should also not add `|=` to MutableMapping, even though it does have an update() method. Adding it (even with a default implementation) could cause discrepancies to virtual subclasses registered with MutableMapping.register(C).

--
--Guido van Rossum (python.org/~guido)