Skip to content

Instantly share code, notes, and snippets.

@munro
Created December 14, 2011 02:19
Show Gist options
  • Save munro/1474935 to your computer and use it in GitHub Desktop.
Save munro/1474935 to your computer and use it in GitHub Desktop.
python9001
# named functions
def HelloWorld(str, fn, str2):
pass
# single statement anonymous function
helloWorld('foo', lambda x, y: foo(x, y), 'bar')
# multi statement anonymous functions
helloWorld('foo', (lambda x, y:
arbitraryMulti(x)
lineFunction(y)
return (x, y,)
), 'bar')
# named functions
def HelloWorld(str, fn, str2):
pass
# single statement anonymous function
helloWorld('foo', def (x, y): foo(x, y), 'bar')
# multi statement anonymous functions
helloWorld('foo', (def (x, y):
arbitraryMulti(x)
lineFunction(y)
return (x, y,)
), 'bar')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment