Best way to check that you are at the beginning (the end) of an iterable?

Miki Tebeka miki.tebeka at gmail.com
Wed Sep 7 20:24:53 EDT 2011


I guess enumerate is the best way to check for first argument. Note that if someone passes you the iterator as argument you have now way of checking if the consumed items from it.

istail can be implemented using itertools.chain, see https://gist.github.com/1202260



More information about the Python-list mailing list