Skip to content

Instantly share code, notes, and snippets.

@bergerx
Last active August 11, 2016 14:57
Show Gist options
  • Save bergerx/e8b20a2fbd3c47074bf5861b7e2fa598 to your computer and use it in GitHub Desktop.
Save bergerx/e8b20a2fbd3c47074bf5861b7e2fa598 to your computer and use it in GitHub Desktop.
zip(*(iter(items),)*2)
items=[1,2,3,4]
items --> [1,2,3,4]
iter(items) --> <listiterator at 0x7f4d642273d0>
(iter(items) ) --> <listiterator at 0x7f4d64227690>
(iter(items), ) --> (<listiterator at 0x7f4d64227690>,)
(iter(items), ) * 2 --> (<listiterator at 0x7f4d64227590>, <listiterator at 0x7f4d64227590>)
zip(* (iter(items),)*2 ) --> zip(<listiterator at 0x7f4d64227590>, <listiterator at 0x7f4d64227590>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment