Skip to content

Iteration order of Dict #56841

@3f6a

Description

@3f6a

If dict::Dict, are all of the following:

keys(dict)
values(dict)
pairs(dict)
[(k,v) for (k,v) in dict]

guaranteed to iterate entries of dict in the same order ?

Currently the documentation states that keys(dict) and values(dict) iterate in the same order. But it is not stated whether this is the same order as that used by pairs(dict), or when looping, for (k,v) in dict.

If this is guaranteed, can it be mentioned explicitly in the documentation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    collectionsData structures holding multiple items, e.g. setsdocsThis change adds or pertains to documentationiterationInvolves iteration or the iteration protocol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions