| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -4755,11 +4755,12 @@ other sequence-like behavior. | |
|
|
||
| There are currently two built-in set types, :class:`set` and :class:`frozenset`. | ||
| The :class:`set` type is mutable --- the contents can be changed using methods | ||
| like :meth:`~set.add` and :meth:`~set.remove`. Since it is mutable, it has no | ||
| hash value and cannot be used as either a dictionary key or as an element of | ||
| another set. The :class:`frozenset` type is immutable and :term:`hashable` --- | ||
| its contents cannot be altered after it is created; it can therefore be used as | ||
| a dictionary key or as an element of another set. | ||
| like :meth:`add <frozenset.add>` and :meth:`remove <frozenset.add>`. | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThere is no frozenset.add().
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityBecause set and frozenset are documented together, there is no cross-reference target for set.add, it is labelled as frozenset.add instead. This link goes to the correct place.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityBut this is a wrong name for anchor. We should do something with this.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI agree. I plan to fix it, but it requires changes (& a release) of Sphinx. This PR makes the reference link to the right place, and more importantly means that no future reference errors can be introduced into stdtypes.rst. Once it is fixed, I plan to go back and update here & a few other places where we have used a different target to the intended one.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityNow, I think that we should reorganize the set/frozenset documentation in the way similar to the sequence or bytes/bytearray documentation.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality#141857 implements this approach.
Sorry, something went wrong.
All reactions
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityWrong reverence to remove().
Sorry, something went wrong.
All reactions
|
||
| Since it is mutable, it has no hash value and cannot be used as | ||
| either a dictionary key or as an element of another set. | ||
| The :class:`frozenset` type is immutable and :term:`hashable` --- | ||
| its contents cannot be altered after it is created; | ||
| it can therefore be used as a dictionary key or as an element of another set. | ||
|
|
||
| Non-empty sets (not frozensets) can be created by placing a comma-separated list | ||
| of elements within braces, for example: ``{'jack', 'sjoerd'}``, in addition to the | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.