Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Oh, or more directly:

    [f(a, b) for a, b in it.permutations(some_list, r=2)]
And then you could also use itertools.starmap instead of using a comprehension at all, if you wanted.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: