* Chow Loong Jin <hyper...@debian.org>, 2013-06-09, 18:19:
* URL : https://pypi.python.org/pypi/first
[...]
A MIT licensed Python package with a simple function that returns
the first true value from an iterable, or None if there is none. If
you need more power, you can also supply a key function that is used
to judge the truth value of the element or a default value if None
doesn’t fit your use case.
Is that a dependency for something else?
The software contains 10 lines that can be considered code.
I haven't looked at the code but you can do this in one line with
itertools and a combination of keepwhile and dropwhile.
An example would be helpful, I think. I don't think it's immediately
obvious to most people.
Upstream documents a few one-liner alternatives:
https://pypi.python.org/pypi/first#Alternatives
The point of this package is not to make things shorter, but more
readable. </devil's-advocate>
--
Jakub Wilk
--
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130609105626.ga3...@jwilk.net