[Python-Dev] Small misleadingness in docs

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Feb 14 03:07:25 CET 2009


Raymond Hettinger wrote:

> This smells like a bug that brings issubclass() out of sync with 
> isinstance().

No, it affects both isinstance() and issubclass().
They both raise a TypeError if the purported class
object doesn't have a __bases__ attribute that is
a tuple.

This isn't necessarily wrong, but perhaps the docs
could be re-worded slightly to make this clearer.

Another thing is that this whole paragraph only
appears in the Python/C API reference, not in the
docs for the Python isinstance and issubclass
functions, where the docs imply that only genuine
class or type objects are accepted.

And nowhere does it mention that __bases__ must
be a tuple.

-- 
Greg


More information about the Python-Dev mailing list