[Python-ideas] should `dict` supply a default `__missing__` implementation?
michael.selik at gmail.com
Tue Jul 5 18:18:33 EDT 2016
On Tue, Jul 5, 2016 at 6:15 PM Neil Girdhar <mistersheik at gmail.com> wrote:
> Is it deprecated?
> I've seen this question a lot on stackoverflow:
> I still have no idea what the right answer is.
> On Tue, Jul 5, 2016 at 6:11 PM Guido van Rossum <guido at python.org> wrote:
>> Because you shouldn't be using UserDict.
Subclass dict when you only want to change exactly the methods you
override, and/or implement __missing__.
Subclass MutableMapping when you want to take advantage of the mixin
methods interacting with your implementations of the abstract methods.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas