Why inspect.isclass says iter() a class?
cspealma at redhat.com
Wed Apr 10 15:23:09 EDT 2019
Because it is. Many things are classes. calling itertools.chain(a, b)
creates an itertools.chain instance that you can iterate over. What else
did you think it would be?
On Wed, Apr 10, 2019 at 3:17 PM Arup Rakshit <ar at zeit.io> wrote:
> From docs https://docs.python.org/3/library/itertools.html#itertools.chain
> I see that itertools.chain is defined as a function. But then why
> inspect.isclass(chain) is saying it as class.
> from itertools import chain
> # True
> Arup Rakshit
> ar at zeit.io
SENIOR QUALITY ENGINEER
cspealma at redhat.com M: +1.336.210.5107
TRIED. TESTED. TRUSTED. <https://redhat.com/trusted>
More information about the Python-list