News for hackers. Stuff that matters.
Re:Python: The Dictionary Playbook by bismark on Wednesday January 02, 2013 @11:15PM (#5000986)
I also find the combination of lambda and defaultdict quite useful:

  d = defaultdict(lambda: False)
or

  d = defaultdict(lambda: {'foo':set(), 'bar':False})
  d['baz']['foo'].add(1)
Re:Python: The Dictionary Playbook by ralph on Thursday January 03, 2013 @04:30AM (#5001587)
For the first I do defaultdict(bool) ;-)