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 — `defaultdict | frozendict` returns `dict`, not `defaultdict` · Issue #149534 · python/cpython

defaultdict | frozendict returns dict, not defaultdict #149534

New issue
Copy link
New issue
Copy link
Closed
Closed
defaultdict | frozendict returns dict, not defaultdict#149534
Copy link
Labels
3.15bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@JelleZijlstra
JelleZijlstra
opened on May 8, 2026
Issue body actions

Bug report

Bug description:

Compare:

>>> type(defaultdict(int) | frozendict())
<class 'dict'>
>>> type(OrderedDict() | frozendict())
<class 'collections.OrderedDict'>
>>> type(defaultdict(int) | dict())
<class 'collections.defaultdict'>

This should be fixable by making defaultdict's nb_or use PyAnyDict_Check instead of PyDict_Check.

CPython versions tested on:

3.15

Operating systems tested on:

No response

Linked PRs

  • gh-149534: Fix unification of defaultdict and frozendict with | #149539
  • [3.15] gh-149534: Fix unification of defaultdict and frozendict with | (GH-149539) #150709

Activity

  1. JelleZijlstra
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    3.15bugs and security fixesbugs and security fixes
    on May 8, 2026
  2. StanFromIreland
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    on May 9, 2026
  3. StanFromIreland
    changed the title [-]defaultdict | frozendict returns dict, not defaultdict[/-] [+]`defaultdict | frozendict` returns `dict`, not `defaultdict`[/+] on May 9, 2026
  4. sobolevn
    added 2 commits that reference this issue on Jun 1, 2026

    gh-149534: Fix unification of `defaultdict` and `frozendict` with `|` (…

    cc02693

    [3.15] gh-149534: Fix unification of `defaultdict` and `frozendict` w…

    3a12e9f
  5. sobolevn
    closed this as completedon Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — 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.