<div dir="ltr">Lol, well, I think it should.<div><br></div><div>Anyway, the cons are that yes some people's bad code won't work. The pros are that unsuspecting users won't fall into the trap associated with inheriting from dict, list or set. Of course, people on python-ideas know the pitfalls of inheriting from builtin types. You're not users that benefit from this change. It's people who don't know the problems and have no way of finding out until they spend a day debugging why overriding some method on a derived class of a derived class that ultimately inherits from dict doesn't work. Experts always want to make their own lives better. That's the problem with a language made by experts. New users fall into traps that you will never fall into (again).</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Apr 21, 2016 at 1:48 AM Chris Angelico <<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Apr 21, 2016 at 3:33 PM, Neil Girdhar <<a href="mailto:mistersheik@gmail.com" target="_blank">mistersheik@gmail.com</a>> wrote:<br>
>> Why should I inherit from UserDict instead? I have to import that from<br>
>> somewhere (is it in types? collections? though presumably your error<br>
>> message would tell me that), and then I have to contend with the fact<br>
>> that my class is no longer a dictionary.<br>
><br>
><br>
> Of course it's a dictionary. It's an abc.Mapping, which is all a user of<br>
> your class should care about. After all, it "quacks like a duck", which is<br>
> all that matters.<br>
<br>
Your first sentence is in conflict with your other statements. My type<br>
is simply *not* a dictionary. You can start raising bug reports all<br>
over the place saying "JSON should look for abc.Mapping rather than<br>
dict", but I'm not even sure that it should.<br>
<br>
ChrisA<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
<br>
--<br>
<br>
---<br>
You received this message because you are subscribed to a topic in the Google Groups "python-ideas" group.<br>
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/python-ideas/7nFQURLhlQY/unsubscribe" rel="noreferrer" target="_blank">https://groups.google.com/d/topic/python-ideas/7nFQURLhlQY/unsubscribe</a>.<br>
To unsubscribe from this group and all its topics, send an email to <a href="mailto:python-ideas%2Bunsubscribe@googlegroups.com" target="_blank">python-ideas+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" rel="noreferrer" target="_blank">https://groups.google.com/d/optout</a>.<br>
</blockquote></div>