[Python-Dev] Small misleadingness in docs (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Sat Feb 14 02:27:29 CET 2009
- Previous message: [Python-Dev] lifting of prohibition against readlines inside a "for line in file" in Py3?
- Next message: [Python-Dev] Small misleadingness in docs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I've discovered something slightly misleading in the docs for PyObject_IsInstance:
When testing if B is a subclass of A, if A is B, PyObject_IsSubclass returns true. If A and B are different objects, B‘s bases attribute is searched...
This suggests that issubclass(A, A) will always be true, regardless of what attributes A has. However, this turns out not to be so -- A must also have a bases attribute, otherwise it's rejected as not being sufficiently class-like.
-- Greg
- Previous message: [Python-Dev] lifting of prohibition against readlines inside a "for line in file" in Py3?
- Next message: [Python-Dev] Small misleadingness in docs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]