
Dec. 9, 2019
6:35 p.m.
[Steven D'Aprano <steve@pearwood.info>]
What do you think of my suggestion that we promote the itertools recipe "take" into a function?
https://mail.python.org/archives/list/python-ideas@python.org/message/O5RYM6...
That it's independent of whether `first()` should be added. I would _much_ rather write - and read: a = first(iterable, default) than a = take(1, iterable, default)[0] for much the same reasons I'd much rather write and read "2" than "int(10 / 5)" ;-) But, as stated before, I'm not a minimalist when it comes to itertools. In turn, I'd much rather write & read`take(n, iterable, default) than the stuff it takes to plug in "enough" defaults, when needed, without it.