On Sat, Feb 22, 2020 at 4:45 PM Brandt Bucher <brandtbuc...@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)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/ZYS4QSU4NIISYCYUZO2QZIVSNC5FYC2A/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to