"Equal values should have equal hashes regardless of their types" one of the most important points I found from this talk and also, copy() the dict to shrink it down if lots of deletion.
So, does the lookup then try to match the key every time the has points to a given slot? And then if the key goes not match, it goes through successive keys until it finds a match? This would seem to say to me that unless you need to and cannot use a list, stay away from dicts? And so this is really a trick lecture ... only a problem with miniscule sizes of dicts, but seems like you always are wasting 1/3 of the space allocated for your dict addressiing since it will resize, quadrupling or doubling when it gets to 2/3? No problem, RAM is cheap!
When going for lookup, how is the path to a certain key known? Is it stored/cached when the dict was being formed? Or is the path taken, dependent on the higher bits of the hash?
A hash function return the same hash for one value. So given any value, a hash function can retrieve where a data is stored. That's why here it use bit() function because every value have a unique 'bits' value representation.
Where can we find specific documentation about this, or will we have to derive an understanding of this by using a C debugger or a static analysis of the C source?
May your hashes be unique, Your Has tables never full. And may your keys rarely collide as well
Amen!
Ameen
After watching this, I bet I'll land that CEO role in Google.
The clearest Python dictionary background explanation! Thanks!
The way he says "Baaaaal" dying. Amazing detailed presentation, thank you!
Someone opted against taking a general ed in Classics. Buh-all, Ay-Jacks ^_^
"Equal values should have equal hashes regardless of their types" one of the most important points I found from this talk and also, copy() the dict to shrink it down if lots of deletion.
why is the video quality so bad???
Kickass!! Really well explained!
Used words from an English dictionary to input elements into a Python dictionary. And all the undergrads screamed in agony.
What if value is a large string that doesn't fit between two hashed memory pointers? I think something is missing from how this really works.
Awesome talk!
So, does the lookup then try to match the key every time the has points to a given slot? And then if the key goes not match, it goes through successive keys until it finds a match? This would seem to say to me that unless you need to and cannot use a list, stay away from dicts?
And so this is really a trick lecture ... only a problem with miniscule sizes of dicts, but seems like you always are wasting 1/3 of the space allocated for your dict addressiing since it will resize, quadrupling or doubling when it gets to 2/3? No problem, RAM is cheap!
When going for lookup, how is the path to a certain key known?
Is it stored/cached when the dict was being formed?
Or is the path taken, dependent on the higher bits of the hash?
24:26
A hash function return the same hash for one value.
So given any value, a hash function can retrieve where a data is stored.
That's why here it use bit() function because every value have a unique 'bits' value representation.
The clearest Python dictionary background explanation! Thanks! BTW, slides: rhodesmill.org/brandon/slides/2010-03-pycon/
Where can we find specific documentation about this, or will we have to derive an understanding of this by using a C debugger or a static analysis of the C source?
This was very helpful
What is the "bits" function you're using?
+Sebastian Wozny It is something like:
def bits(integer):
return bin(integer)[2:]
It's right there in the video at 0:12:
def bits(n):
n+=2**32
return bin(n)[-32:]