Is my analysis correct?
unhashable set():
(We are aware that) the location of elements in a set() is interchangeable. However, the concealed hash function’s rule is ‘unhashable’ on set() in programming languages.
For example, we know that {1, 2} is equivalent to {2, 1}.
Nevertheless, the Python language violates the hash function(invisible rule) when it iterates through a set {a1, a2,…}, which is a one-to-one function that is “unhashable,” according to my findings.
r = range
# a = {{4*x**2 - 4*x -15} & {x**2 - 5*x - 6} for x in r(-10, 10)}
# print(a)
b = {{x + 1} for x in r(-10, 10)}
print(b)
> > TypeError: unhashable type: 'set'
8 posts - 4 participants