This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/util/itertoolrecipes.py
2019-11-12 11:09:47 -05:00

6 lines
202 B
Python

from itertools import islice
# From: https://docs.python.org/2/library/itertools.html
def take(n, iterable):
""" Return first n items of the iterable as a list """
return list(islice(iterable, n))