PyCon 2010: The Mighty Dictionary

Поделиться
HTML-код
  • Опубликовано: 18 окт 2024

Комментарии • 24

  • @k3v1l
    @k3v1l 10 лет назад +50

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

  • @DenisBTV
    @DenisBTV 7 лет назад +11

    The clearest Python dictionary background explanation! Thanks!

  • @akshy471
    @akshy471 2 года назад +2

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

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

  • @vikingden8402
    @vikingden8402 6 лет назад +4

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

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

  • @tomaszszulc7259
    @tomaszszulc7259 8 лет назад +1

    Awesome talk!

  • @drizzyDreF
    @drizzyDreF 7 лет назад +1

    This was very helpful

  • @sohangchopra6478
    @sohangchopra6478 3 года назад +2

    why is the video quality so bad???

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

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

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

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

  • @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:]