nexus, index source, nexus main
A wish list… topics I’d like to understand
iterable
yield
decorators
class
under what circumstances? (see manim
Scene)__hash__()
method)
hash(som_object)
to raise an error if it is not hashable__eq__()
and/or __cmp__()
method)This code:
print('this string', hash('this string'))
print(10, hash(10))
n = 10
print(n, hash(n))
n = 10.0
print(n, hash(n))
n = 10.1
print(n, hash(n))
produces
this string 8534039767811493564
10 10
10 10
10.0 10
10.1 230584300921368586
So 10^20 is roughly the dynamic range apparent in Python hashing. This is the case as well for larger objects such as a string of 600 characters. There are say (10^2)^20 possible strings of length 20… so surely it is possible to have hash collisions. These do happen (and the birthday paradox is relevant). There are two ideas to note in consequence: