Skip to content

Instantly share code, notes, and snippets.

@dmohs
Last active July 27, 2017 19:57
Show Gist options
  • Save dmohs/fd03357fb0dcdfb1278592d3e091531e to your computer and use it in GitHub Desktop.
Save dmohs/fd03357fb0dcdfb1278592d3e091531e to your computer and use it in GitHub Desktop.
Python does not have anonymous procedures.
foo = range(10)
foo.sort(key=lambda x: -x); print 'foo: '+str(foo)
# Suppose something isn't working. Let's try debugging this:
foo.sort(key=lambda x: print 'x: '+str(x); -x) # -> Syntax error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment