Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
GH-134863: Add reversible keys, values, items views to collections.abc builtin library#134877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
…ons.abc builtin library
python-cla-botbot commentedMay 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We need a test case for this, and the docs need to be updated.
Misc/NEWS.d/next/Library/2025-05-29-10-04-00.gh-issue-134863.iQl1kn.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…Ql1kn.rstCo-authored-by: Peter Bierma <zintensitydev@gmail.com>
Please read the maintenance notes at the top of this file. |
t1m013y commentedMay 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Will it be OK to add new ABCs (for example, |
rhettinger commentedMay 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
That would work, but it doesn't seem worth it. There is almost zero benefit. These ABCs have been around a long time and no one has missed the reversible spec. Likely, this is because the concrete In general, the ABCs are intentionally not full featured. The intent of the ABCs was to be a minimal spec. For example, MutableSet lacks union, intersection, and difference; the operators are supposed to suffice. One other thought is that reversibility is only meaningful if the underlying mapping is ordered, but we have no way to specify or enforce an ordering requirement with ABCs so this would be on shaky ground. |
t1m013y commentedMay 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
So do you want to say that you will not merge this PR and PR with new ABCs? I want to add reversibility because:
|
See alsoGH-134863
|
GH-134863
Made
collections.abc.Mapping
's keys, values, items views reversible by adding__reversed__
method