Skip to content

Instantly share code, notes, and snippets.

@rayboyd
Created October 5, 2009 23:58
Show Gist options
  • Save rayboyd/202614 to your computer and use it in GitHub Desktop.
Save rayboyd/202614 to your computer and use it in GitHub Desktop.
from waveapi import simplejson
data = simplejson.loads(JSON)
"""TODO"""
def trace(obj):
yield obj
sprint = (lambda key, value: '%s => %s' % (key, value))
typeof = (lambda obj, collection: type(obj) in collection)
jsproc = (lambda x, y: typeof(x, y) and
(lambda x, y: trace(y[x])) or
(lambda x, y: sprint(x, y[x])))
for item in sorted(data):
print jsproc(data[item],[dict, list])(item, data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment