Alex Waygood <alex.wayg...@gmail.com> added the comment:

I agree with Inada that not every internal type should be exposed, but I would 
make an exception for the dict views classes due to the fact that dict 
subclasses are much more common than subclasses of other mappings, such as 
OrderedDict. I don't think it's *particularly* important to expose the 
OrderedDict views classes in the same way.

Adding the "mapping" attribute to KeysView/ValuesView/ItemsView seems like it 
could be quite disruptive — there may be a lot of third-party users with 
classes that inherit from those, who'd need to make changes to their code. From 
a typing perspective, it would also mean that KeysView and ValuesView would 
have to be parameterised with two TypeVars (key-type and value-type), whereas 
now they both only take one (KeysView is parameterised with the key-type, 
ValuesView with the value-type).

----------

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

Reply via email to