Skip to content

Instantly share code, notes, and snippets.

@mvanveen
Forked from mvanveen/a_one_liner.py
Created March 25, 2011 05:12
Show Gist options
  • Save mvanveen/886398 to your computer and use it in GitHub Desktop.
Save mvanveen/886398 to your computer and use it in GitHub Desktop.
import sys
def retr(item):
return({ type('') : lambda x: sys.stdout.write(x+'\n'),
type([]) : lambda item: ''.join(retr(x) for x in item)
}[type(item)](item))
retr('lol')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment