Finding the first index in a list greater than a particular value

Michael Selik michael.selik at gmail.com
Mon Aug 15 10:07:31 EDT 2016


On Mon, Aug 15, 2016 at 2:01 AM Jussi Piitulainen <
jussi.piitulainen at helsinki.fi> wrote:

> There is a tradition of returning -1 when no valid index is found.
>

Sometimes it's better to break with tradition. Raise a ValueError. No
silent errors, and all that Zen.



More information about the Python-list mailing list