Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

defaultdict | frozendict returns dict, not defaultdict #149534

Copy link
Copy link
@JelleZijlstra

Description

@JelleZijlstra
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

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs 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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.