One-line Tree In Python
Neat.  Works in Ruby, too.  def tree; Hash.new {|h, k| h[k] = tree }; end
  t = tree
  t[:foo][:bar] = "foobar"  # => {:foo=>{:bar=>"foobar"}}

Probably more idiomatic to do it as a class, though.  class Tree < Hash
    def initialize
      super {|h,k|  h[k] = Tree.new }
    end
  end

Btw.  How do you post nicely formatted code?edit - Thanks!