Jack DeVries <jdevries3...@gmail.com> added the comment:

There was a thorough discussion about the concerns associated with supporting 
dict subclasses in general here: bpo-32615

If I understand correctly, allowing dict subclasses to inherit __contains__ and 
__getitem__ will be a step towards supporting dict subclasses in a more broad 
context, like being able to use them as namespaces passed to exec. 

Ultimately, dictionaries are at the very heart of Cpython's implementation. I 
think it is reasonable to say that it is not possible or reasonable to support 
users in creating custom dict implantation with their own behavior. There is no 
good real world use case for it (please tell me if anyone has one), and it 
opens the door to enormous unnecessary complexity. 

Also related to dict subclassing:
bpo-15099
bpo-27561

Marco, I hope that the discussions I've linked will at least make it clear why 
cpython behaves this way, and what the concerns are especially around 
supporting user subclasses of dict. I noticed you tagged this bpo as 
performance, but there are significant negative performance implications around 
dict subclasses that you'll see in past discussions.

With this additional context in mind, what changes do you propose?

----------
nosy: +jack__d

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44921>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to