Skip to content

odict_items and dict_items' repr's don't match OrderedDict's and dict's #113802

Closed as not planned
@jab

Description

@jab

Bug report

Bug description:

As of #101446, OrderedDict's repr now looks like dict's, but their ItemsViews were not updated to match.

python3.12
Python 3.12.0 (main, Oct  2 2023, 12:03:24) [Clang 16.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import OrderedDict
>>> OrderedDict({1: -1, 2: -2})  # no longer looks like a list of pairs
OrderedDict({1: -1, 2: -2})
>>> OrderedDict({1: -1, 2: -2}).items()  # still looks like a list of pairs
odict_items([(1, -1), (2, -2)])
>>> {1: -1, 2: -2}.items()  # ditto
dict_items([(1, -1), (2, -2)])

CPython versions tested on:

3.12

Operating systems tested on:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingThe issue will be closed if no feedback is providedtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions