JelleZijlstra · GitHub

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

Read the original on github.com ↗