Skip to content

Instantly share code, notes, and snippets.

@benhoyt
Created September 10, 2018 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benhoyt/e211858be3786a02b0f93153428effea to your computer and use it in GitHub Desktop.
Save benhoyt/e211858be3786a02b0f93153428effea to your computer and use it in GitHub Desktop.
Example of tuple unpacking in lambda parameters
$ python
Python 2.7.14 (default, Mar 1 2018, 19:26:37)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> f = lambda x, (y, z): x+y+z
>>> f(1, (2, 3))
6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment