Settings

Theme

Show HN: FlexDict – Deeply Nested Python Dictionaries with Ease

github.com

16 points by berkayozturk 6 years ago · 1 comment

Reader

lrobinovitch 6 years ago

This is cool! Would easily replace the slightly tricky to grok code I came across to make a binary trie last week:

  # in for loop:
      node = trie
      for char in number:
          node = node.setdefault(char, {})
  
(from here: https://www.hackerrank.com/challenges/maximum-xor/forum)

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection