Testing if an index is in a slice

mmanns at gmx.net mmanns at gmx.net
Thu Jan 1 19:15:00 CET 2009


I would like to check if an index is in a slice or not without
iterating over the slice.

Something like:

>>> isinslice(36, slice(None, 34, -1))

I would like to use the batteries if possible.
However, I looked in the docs, pypi and in Usenet without luck.

Does anyone have a solution?


More information about the Python-list mailing list