PyCon 2010: The Mighty Dictionary

Поділитися
Вставка
  • Опубліковано 4 лис 2024

КОМЕНТАРІ • 24

  • @k3v1l
    @k3v1l 10 років тому +50

    May your hashes be unique, Your Has tables never full. And may your keys rarely collide as well

  • @akshy471
    @akshy471 2 роки тому +2

    After watching this, I bet I'll land that CEO role in Google.

  • @DenisBTV
    @DenisBTV 7 років тому +11

    The clearest Python dictionary background explanation! Thanks!

  • @Naz-yi9bs
    @Naz-yi9bs 3 роки тому +2

    The way he says "Baaaaal" dying. Amazing detailed presentation, thank you!

    • @dschonhaut
      @dschonhaut Місяць тому

      Someone opted against taking a general ed in Classics. Buh-all, Ay-Jacks ^_^

  • @kartikeysingh9764
    @kartikeysingh9764 4 роки тому +1

    "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.

  • @sohangchopra6478
    @sohangchopra6478 3 роки тому +2

    why is the video quality so bad???

  • @surashreekulkarni6115
    @surashreekulkarni6115 7 років тому +5

    Kickass!! Really well explained!

  • @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.

  • @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.

  • @tomaszszulc7259
    @tomaszszulc7259 8 років тому +1

    Awesome talk!

  • @justgivemethetruth954
    @justgivemethetruth954 7 років тому +1

    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!

  • @hiwaqas
    @hiwaqas 7 років тому +1

    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 роки тому +1

      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.

  • @vikingden8402
    @vikingden8402 6 років тому +4

    The clearest Python dictionary background explanation! Thanks! BTW, slides: rhodesmill.org/brandon/slides/2010-03-pycon/

  • @aaronhall8039
    @aaronhall8039 9 років тому

    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?

  • @drizzyDreF
    @drizzyDreF 7 років тому +1

    This was very helpful

  • @4rph3n
    @4rph3n 9 років тому +3

    What is the "bits" function you're using?

    • @aaronhall8039
      @aaronhall8039 9 років тому +2

      +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:]