GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-141510 Document and test frozendict class matching behaviour by da-woods · Pull Request #150799 · python/cpython

Conversation

@da-woods

@da-woods da-woods commented Jun 2, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Frozendict has _Py_TPFLAGS_MATCH_SELF set so works correctly with the single-arg class matching. However it isn't documented in the list of classes this works with and it isn't tested.

The test is some way below the other similar tests but anything else would need a large renumbering

  • Issue: PEP 416: Add a builtin frozendict type #58370
  • Issue: PEP 814: Add built-in frozendict type #141510

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@da-woods
pythongh-58370 Document and test frozendict class matching behaviour
091478e
Frozendict has `_Py_TPFLAGS_MATCH_SELF` set so works correctly
with the single-arg class matching. However it isn't documented
in the list of classes this works with and it isn't tested.

The test is some way below the other similar tests but anything
else would need a large renumbering
@da-woods
da-woods requested review from AA-Turner, brandtbucher and willingc as code owners June 2, 2026 16:21
@bedevere-app bedevere-app Bot mentioned this pull request Jun 2, 2026
PEP 416: Add a builtin frozendict type #58370
Closed
@bedevere-app bedevere-app Bot added awaiting review tests Tests in the Lib/test dir labels Jun 2, 2026
@da-woods

da-woods commented Jun 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

I'm assuming this is fine to bundle onto the original frozendict issue, but can change that if needed

(...Although I originally linked it to a previous reject proposal by mistake...)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@read-the-docs-community

read-the-docs-community Bot commented Jun 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33198800 | 📁 Comparing 60c7221 against main (f7e0fb6)

  🔍 Preview build  

118 files changed · + 2 added · ± 116 modified

+ Added

  • howto/abi3t-migration.html
  • library/asyncio-threading.html

± Modified

  • bugs.html
  • glossary.html
  • c-api/complex.html
  • c-api/coro.html
  • c-api/exceptions.html
  • c-api/gen.html
  • c-api/init_config.html
  • c-api/interp-lifecycle.html
  • c-api/long.html
  • c-api/memory.html
  • and 106 more...
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@da-woods da-woods changed the title gh-58370 Document and test frozendict class matching behaviour gh-141510 Document and test frozendict class matching behaviour Jun 4, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jun 4, 2026
PEP 814: Add built-in frozendict type #141510
Closed
vstinner
vstinner reviewed Jun 18, 2026
View reviewed changes
Comment thread Lib/test/test_patma.py Outdated
self.assertEqual(x, 0)
self.assertEqual(y, 1)

def test_patma_267(self):

@vstinner vstinner Jun 18, 2026

Copy link
Copy Markdown
Member

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.

I don't know the rationale for using an identifier to name the test method. Can you rename it to test_patma_frozendict()?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner vstinner added the skip news label Jun 18, 2026
@vstinner

vstinner commented Jun 18, 2026

Copy link
Copy Markdown
Member

Oh, I didn't notice that I copied _Py_TPFLAGS_MATCH_SELF flag when I implemented frozendict. Thanks for updating the tests and the doc!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@da-woods
More descriptive name
60c7221
@da-woods

da-woods commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Oh, I didn't notice that I copied _Py_TPFLAGS_MATCH_SELF flag when I implemented frozendict

I guess it isn't too late to remove the flag of you don't want it. But I think the flag makes sense.

I've updated the function name to be more descriptive

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
vstinner merged commit fd53ae1 into python:main Jun 18, 2026
51 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting review label Jun 18, 2026
@vstinner

vstinner commented Jun 18, 2026

Copy link
Copy Markdown
Member

Thanks, I merged your change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@da-woods
da-woods deleted the frozendict-self-match branch June 18, 2026 13:46
@vstinner vstinner added the needs backport to 3.15 bugs and security fixes label Jun 19, 2026
@miss-islington-app

miss-islington-app Bot commented Jun 19, 2026

Copy link
Copy Markdown

Thanks @da-woods for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

bedevere-app Bot commented Jun 19, 2026

Copy link
Copy Markdown

GH-151701 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Jun 19, 2026
vstinner pushed a commit that referenced this pull request Jun 19, 2026
@miss-islington @da-woods
[3.15] gh-141510 Document and test frozendict class matching behaviour (
7e36838
GH-150799) (#151701)

gh-141510 Document and test frozendict class matching behaviour (GH-150799)

Frozendict has `_Py_TPFLAGS_MATCH_SELF` set so works correctly
with the single-arg class matching. However it isn't documented
in the list of classes this works with and it isn't tested.

The test is some way below the other similar tests but anything
else would need a large renumbering.
(cherry picked from commit fd53ae1)

Co-authored-by: da-woods <[email protected]>
pyctrl pushed a commit to pyctrl/cpython that referenced this pull request Jul 5, 2026
@da-woods @pyctrl
pythongh-141510 Document and test frozendict class matching behaviour (…
4bc0cdd
…python#150799)

Frozendict has `_Py_TPFLAGS_MATCH_SELF` set so works correctly
with the single-arg class matching. However it isn't documented
in the list of classes this works with and it isn't tested.

The test is some way below the other similar tests but anything
else would need a large renumbering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner left review comments
@brandtbucher brandtbucher Awaiting requested review from brandtbucher brandtbucher is a code owner
@willingc willingc Awaiting requested review from willingc willingc is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@da-woods @vstinner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.