PyCon 2010: The Mighty Dictionary
30:50
Пікірлер
@dzidmail
@dzidmail Жыл бұрын
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.
@akshy471
@akshy471 2 жыл бұрын
After watching this, I bet I'll land that CEO role in Google.
@Naz-yi9bs
@Naz-yi9bs 2 жыл бұрын
The way he says "Baaaaal" dying. Amazing detailed presentation, thank you!
@sohangchopra6478
@sohangchopra6478 2 жыл бұрын
why is the video quality so bad???
@kartikeysingh9764
@kartikeysingh9764 4 жыл бұрын
"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.
@vikingden8402
@vikingden8402 6 жыл бұрын
The clearest Python dictionary background explanation! Thanks! BTW, slides: rhodesmill.org/brandon/slides/2010-03-pycon/
@justgivemethetruth954
@justgivemethetruth954 7 жыл бұрын
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!
@rallokkcaz
@rallokkcaz 7 жыл бұрын
"Because collisions are expensive, dicks resize when they get to 2/3rds full..." @14:48
@DenisBTV
@DenisBTV 7 жыл бұрын
The clearest Python dictionary background explanation! Thanks!
@hiwaqas
@hiwaqas 7 жыл бұрын
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?
@justgivemethetruth954
@justgivemethetruth954 7 жыл бұрын
24:26
@vincentphilippe_18
@vincentphilippe_18 3 жыл бұрын
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.
@drizzyDreF
@drizzyDreF 7 жыл бұрын
This was very helpful
@hamman_samuel
@hamman_samuel 7 жыл бұрын
Used words from an English dictionary to input elements into a Python dictionary. And all the undergrads screamed in agony.
@surashreekulkarni6115
@surashreekulkarni6115 7 жыл бұрын
Kickass!! Really well explained!
@tomaszszulc7259
@tomaszszulc7259 7 жыл бұрын
Awesome talk!
@aaronhall8039
@aaronhall8039 8 жыл бұрын
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?
@4rph3n
@4rph3n 8 жыл бұрын
What is the "bits" function you're using?
@aaronhall8039
@aaronhall8039 8 жыл бұрын
+Sebastian Wozny It is something like: def bits(integer): return bin(integer)[2:]
@jursamaj
@jursamaj 5 жыл бұрын
It's right there in the video at 0:12: def bits(n): n+=2**32 return bin(n)[-32:]
@k3v1l
@k3v1l 10 жыл бұрын
May your hashes be unique, Your Has tables never full. And may your keys rarely collide as well
@RohanAnand417
@RohanAnand417 6 жыл бұрын
Amen!
@ComputerVisionPro
@ComputerVisionPro 3 жыл бұрын
Ameen