Skip to content

Commit a805593

Browse files
committed
Simplified cons.
1 parent c95cf7d commit a805593

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)