-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
base: master
Are you sure you want to change the base?
Improve ImmutableDict doc #58360
Conversation
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ImmutableDict | |
Base.ImmutableDict |
search of a linked list. `ImmutableDict` is `public` rather than | ||
`export`; to access it one must write `Base.ImmutableDict` |
There was a problem hiding this comment.
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
search of a linked list. `ImmutableDict` is `public` rather than | |
`export`; to access it one must write `Base.ImmutableDict` | |
search of a linked list. |
type of the dictionary elements; the returned value will be the head | ||
of the list. To add to the dictionary use |
There was a problem hiding this comment.
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?
The types of elements may be specified; this is useful when keys or | ||
values of `Union` or `Any` types are desired. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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.