my_dict = {}
my_dict["qwerty"] = "some_value"
my_dict[114378642] = "some_other_value"
The above code contains a python dictionary containing two keys, where the first key is of type string and the second key is of type integer. Though both keys are of different types it produces the same hash i.e,
hash("qwerty") = 114378642
hash(114378642) = 114378642
and hence,
hash("qwerty") == hash(114378642) #True
Couldn't get a proper answer until now,
Firstly, I was under an impression that "only two similar objects produce the same hash".
Secondly, how a python dictionary performs collision recovery in the above case?
Finally, what is the initial capacity and of a python dictionary in the first line of code?