Skip to content

Instantly share code, notes, and snippets.

@svetlyak40wt
Last active October 9, 2018 05:53
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 svetlyak40wt/d9885585d70464cb202f1f2deaec83cf to your computer and use it in GitHub Desktop.
Save svetlyak40wt/d9885585d70464cb202f1f2deaec83cf to your computer and use it in GitHub Desktop.
names = ['bobuk', 'umputun', 'ksusha', 'gray']
scores = [100500, 42, 777, 41]
list(map(print, names, scores))
# так надо лямбда будет каждый раз последним аргументом,
# что наверняка неудобно в реализации
map(tuple, names, scores)
params = (names, scores)
list(map(print, *params))
# а вот так уже не напишешь:
map(print, *params)
# А ещё, curring удобнее, когда лямбда первым параметром:
>>> from functools import partial
>>> printer = partial(map, print)
>>> list(printer(names, scores))
bobuk 100500
umputun 42
ksusha 777
gray 41
[None, None, None, None]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment