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

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to