Skip to content

Commit 38facbc

Browse files
authored
Merge pull request #349 from coady/master
Simplified cons.
2 parents 9dec542 + a805593 commit 38facbc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

toolz/itertoolz.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,7 @@ def cons(el, seq):
511511
>>> list(cons(1, [2, 3]))
512512
[1, 2, 3]
513513
"""
514-
yield el
515-
for s in seq:
516-
yield s
514+
return itertools.chain([el], seq)
517515

518516

519517
def interpose(el, seq):

0 commit comments

Comments
 (0)