PennyLaneAI / PennyLaneAI/catalyst

Documentation: Dictionary Ordering in Python

Open
#2,148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
Python
Stars
234
Forks
84
Avg merge
2d 15h
Merged PRs (30d)
66

Description

Minor nitpick in our documentation for catalyst.pipeline which says

Note: As of Python 3.7, the CPython dictionary implementation orders dictionaries based on insertion order. However, for an API guarantee of dictionary order, collections.OrderedDict may also be used.

Actually as of Python 3.7 this is part of the Python standard, all compliant interpreters/compilers should preserve insertion order (as of 3.6 it was merely a CPython implementation detail). The official docs confirm this:

Dictionaries preserve insertion order. Note that updating a key does not affect the order. Keys added after deletion are inserted at the end.
Changed in version 3.7: Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the note in the catalyst.pipeline documentation page linked in the issue and compare it with the official Python dictionary documentation. Update the note to accurately describe insertion-order guarantees from Python 3.7 and the earlier CPython-specific behavior, then verify the rendered wording and links.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.