mirror of
https://github.com/python/cpython.git
synced 2025-11-04 03:44:55 +00:00
Comment repair.
This commit is contained in:
parent
2023c9b84a
commit
d06d03041b
1 changed files with 4 additions and 4 deletions
|
|
@ -297,10 +297,10 @@ class BaseSet(object):
|
||||||
|
|
||||||
def _compute_hash(self):
|
def _compute_hash(self):
|
||||||
# Calculate hash code for a set by xor'ing the hash codes of
|
# Calculate hash code for a set by xor'ing the hash codes of
|
||||||
# the elements. This algorithm ensures that the hash code
|
# the elements. This ensures that the hash code does not depend
|
||||||
# does not depend on the order in which elements are added to
|
# on the order in which elements are added to the set. This is
|
||||||
# the code. This is not called __hash__ because a BaseSet
|
# not called __hash__ because a BaseSet should not be hashable;
|
||||||
# should not be hashable; only an ImmutableSet is hashable.
|
# only an ImmutableSet is hashable.
|
||||||
result = 0
|
result = 0
|
||||||
for elt in self:
|
for elt in self:
|
||||||
result ^= hash(elt)
|
result ^= hash(elt)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue