Skip to content

[dict] .popitem() returns arbitrary element #2

Description

@LukeSavefrogs

See this test.

On Python/Jython <3.6 the order of elements in lists/dictionaries is not guaranteed, and in this cases this leads to unexpected results in the original .popitem() method.

For example, the following could happen on Python 2.7-3.5:

test = {"first": 1, "second": 2, "third": 3}

print(test) # Prints {"third": 3, "first": 1, "second": 2}

Should this be kept as intended behaviour (ordered dictionaries were made default in Python 3.6) or should the polyfill conform to the current standard?

Activity

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

    bugSomething isn't workinglanguage issuesIssues related to differences between the different Python versions or implementations

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions