Skip to content

Improve ImmutableDict doc #58360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Improve ImmutableDict doc #58360

wants to merge 3 commits into from

Conversation

rfritz
Copy link

@rfritz rfritz commented May 8, 2025

I had difficulty using the data structure based on the current version of the docs, so I gathered up what from experimentation, research on the Discourse site, and reading the code and wrote this.

rfritz added 3 commits May 8, 2025 11:58
I had difficulty using the data structure based on the current version of the docs, so I gathered up what from experimentation, research on the Discourse site, and reading the code and wrote this.
Fix whitespace errors
Remove tab.
@vtjnash vtjnash added the docs This change adds or pertains to documentation label May 8, 2025
Copy link
Member

@LilithHafner LilithHafner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for aggregating this and writing it up! It's good to have this documented.

This content is a little too tutorial style for a docstring, which is typically primarily for reference (i.e. concise, precise, and comprehensive specification of the behavior of an object). Perhaps you could put some of it in an "extended help" section (described here) to make the primary docstring a bit shorter.

@@ -778,14 +778,35 @@ end
"""
ImmutableDict
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ImmutableDict
Base.ImmutableDict

Comment on lines +784 to +785
search of a linked list. `ImmutableDict` is `public` rather than
`export`; to access it one must write `Base.ImmutableDict`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be conveyed by example by using Base.ImmutableDict in the opening line

Suggested change
search of a linked list. `ImmutableDict` is `public` rather than
`export`; to access it one must write `Base.ImmutableDict`
search of a linked list.

Comment on lines +792 to +793
type of the dictionary elements; the returned value will be the head
of the list. To add to the dictionary use
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "the head of the list" mean?

Comment on lines +801 to +802
The types of elements may be specified; this is useful when keys or
values of `Union` or `Any` types are desired.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The types of elements may be specified; this is useful when keys or
values of `Union` or `Any` types are desired.
The types of elements may be specified; this is useful when additional keys or values will be added that are not of the same type as the initial elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants