Why inspect.isclass says iter() a class?

Gregory Ewing greg.ewing at canterbury.ac.nz
Thu Apr 11 01:25:34 EDT 2019


Chris Angelico wrote:
> At the moment, it isn't defined particularly as either a function or a
> class,

Well, it's listed under a section called "Functions", so the reader
could be forgiven for assuming that it's a function. From a high
level point of view, it is -- you call it and it returns something.
Concretely, it happens to be implemented as a class, but that's not
something you need to know in order to use it, so the docs don't
mention it.

-- 
Greg


More information about the Python-list mailing list