if iter(iterator) is iterator

Serhiy Storchaka storchaka at gmail.com
Mon Nov 14 01:25:07 EST 2016


On 14.11.16 02:40, Steve D'Aprano wrote:
> I'm surprised that the inspect module doesn't appear to have isiterable and
> isiterator functions. Here's my first attempt at both:

Just use isinstance() with collections ABC classes.





More information about the Python-list mailing list