Title: `defaultdict | frozendict` returns `dict`, not `defaultdict` · Issue #149534 · python/cpython · GitHub
Open Graph Title: `defaultdict | frozendict` returns `dict`, not `defaultdict` · Issue #149534 · python/cpython
X Title: `defaultdict | frozendict` returns `dict`, not `defaultdict` · Issue #149534 · python/cpython
Description: Bug report Bug description: Compare: >>> type(defaultdict(int) | frozendict())
Open Graph Description: Bug report Bug description: Compare: >>> type(defaultdict(int) | frozendict())
X Description: Bug report Bug description: Compare: >>> type(defaultdict(int) | frozendict()) <class 'dict'> >>> type(OrderedDict() | frozendict()) <class 'collections.Order...
Opengraph URL: https://github.com/python/cpython/issues/149534
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`defaultdict | frozendict` returns `dict`, not `defaultdict`","articleBody":"# Bug report\n\n### Bug description:\n\nCompare:\n\n```\n\u003e\u003e\u003e type(defaultdict(int) | frozendict())\n\u003cclass 'dict'\u003e\n\u003e\u003e\u003e type(OrderedDict() | frozendict())\n\u003cclass 'collections.OrderedDict'\u003e\n\u003e\u003e\u003e type(defaultdict(int) | dict())\n\u003cclass 'collections.defaultdict'\u003e\n```\n\nThis should be fixable by making defaultdict's nb_or use PyAnyDict_Check instead of PyDict_Check.\n\n### CPython versions tested on:\n\n3.15\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-149539\n* gh-150709\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2026-05-08T05:02:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/149534/cpython/issues/149534"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d022c41b-b5b2-943e-c595-9be536a3d023 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AEBC:2B05EF:306712:42FE5F:6A55943C |
| html-safe-nonce | 11628cfdc29c08e7f4303d19d3248e63b7586967e92ca7b8725b7d3a777bbc46 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUJDOjJCMDVFRjozMDY3MTI6NDJGRTVGOjZBNTU5NDNDIiwidmlzaXRvcl9pZCI6Ijc3NTUxMTEwOTc0MDE5NzE3NzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | be5defd1aa59255ea7640a7708361950dc71850902e718ac1e36768d66e96ac1 |
| hovercard-subject-tag | issue:4403905405 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/149534/issue_layout |
| twitter:image | https://opengraph.githubassets.com/03d2ce4fc15310e7b5453b649f796871b24ac69bf4df0ba6d0846822d33b76b8/python/cpython/issues/149534 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/03d2ce4fc15310e7b5453b649f796871b24ac69bf4df0ba6d0846822d33b76b8/python/cpython/issues/149534 |
| og:image:alt | Bug report Bug description: Compare: >>> type(defaultdict(int) | frozendict()) |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JelleZijlstra |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | aa21baa44893467b0b640d0300538f84ca8c475b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width