You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sentence 1: "Called for the key object for dictionary operations, and by
the built-in function hash()."
Also called for the members of set and frozenset (and any other hashed
based collection).
Suggestion 1: "Called by the built-in function hash() and for operations
on members or keys of hashed collections. These currently include the
built-in classes set, frozenset, and dict."
Corresponding future-proof changes later in the text:
From "its instances will not be usable as dictionary keys"
to "its instances will not be usable as hashable members or keys".
From "since the dictionary implementation requires"
to "since hashable collection implementations require"
==============================
Sentence 2: "Should return an integer usable as a hash value for
dictionary operations."
I am confused by the qualification 'usable....'. If it does not
qualify, it is meaningless and should be removed. If it does qualify,
it should be replaced by what it means.
My impression is that integers of any value are usable since 2.5.
It is also my impression that 2.x specifically requires an int or long.
If so, "Should return an int or long integer." would be clearer.
For 3.0, I don't know what the boundaries are. A float works, even if
not integral. [bug?] A Fraction does not, even if integral, even though
int(Fraction(n,1)) returns n.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: