On Mon, Jun 1, 2015, at 21:15, TheDoctor wrote:
> In Python 2.7 type(type) is type (not object), but isinstance(type,
> object) is true -- so it is ambiguous, even contradictory, in the
> language.

isinstance(type, object) is true because object is the parent class of
type. issubclass(type, object) is also true, and that is why
isinstance(int, object) is true. There is no more contradiction than in
anything else being an instance of its own class, its parent class, that
class's parent class, and ultimately... well, object.

type in object.__subclasses__() is also true.
type.__base__ is object.

I could go on.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to