Skip to content

Instantly share code, notes, and snippets.

@singingwolfboy
Created March 18, 2017 17:13
Show Gist options
  • Save singingwolfboy/fb24604cfa41cc8b89ea23456ba7d571 to your computer and use it in GitHub Desktop.
Save singingwolfboy/fb24604cfa41cc8b89ea23456ba7d571 to your computer and use it in GitHub Desktop.
iterable unpacking works with generators, too!
>>> def generator():
... yield 4
... yield 5
...
>>> x, y = generator()
>>> x
4
>>> y
5
>>> # mind blown!!
@iamdv
Copy link

iamdv commented Mar 18, 2017

nice, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment