This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author AlexWaygood
Recipients AlexWaygood, Dennis Sweeney, JelleZijlstra, gvanrossum, kj, kumaraditya, methane, rhettinger, serhiy.storchaka, sobolevn
Date 2022-01-19.08:59:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642582784.05.0.739865395887.issue46399@roundup.psfhosted.org>
In-reply-to
Content
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).
History
Date User Action Args
2022-01-19 08:59:44AlexWaygoodsetrecipients: + AlexWaygood, gvanrossum, rhettinger, methane, serhiy.storchaka, JelleZijlstra, Dennis Sweeney, sobolevn, kj, kumaraditya
2022-01-19 08:59:44AlexWaygoodsetmessageid: <1642582784.05.0.739865395887.issue46399@roundup.psfhosted.org>
2022-01-19 08:59:44AlexWaygoodlinkissue46399 messages
2022-01-19 08:59:43AlexWaygoodcreate