File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2210,12 +2210,12 @@ Basic customization
22102210 pair: built-in function; hash
22112211
22122212 Called by built-in function :func: `hash ` and for operations on members of
2213- hashed collections including :class: `set `, :class: `frozenset `, and
2214- :class: `dict `. The ``__hash__() `` method should return an integer. The only required
2215- property is that objects which compare equal have the same hash value; it is
2216- advised to mix together the hash values of the components of the object that
2217- also play a part in comparison of objects by packing them into a tuple and
2218- hashing the tuple. Example::
2213+ hashed collections including :class: `set `, :class: `frozenset `, :class: ` dict `
2214+ and :class: `frozendict `. The ``__hash__() `` method should return an integer.
2215+ The only required property is that objects which compare equal have the same
2216+ hash value; it is advised to mix together the hash values of the components
2217+ of the object that also play a part in comparison of objects by packing them
2218+ into a tuple and hashing the tuple. Example::
22192219
22202220 def __hash__(self):
22212221 return hash((self.name, self.nick, self.color))
You can’t perform that action at this time.
0 commit comments