On May 12, 2:29 pm, Ethan Furman <[email protected]> wrote:
> While it is wrong (it should have 'built-in' precede the word 'types'),
> it is not wrong in the way you think -- a subclass *is* a type of its
> superclass.
Well, consider this:
class List_A(list):
"A list subclass"
class List_B(list):
"Another list subclass"
a = List_A()
b = List_B()
print a == b
It prints "True". Neither a nor b are a type of the other:
print isinstance(List_A, List_B)
print isinstance(List_B, List_A)
False
False
--
http://mail.python.org/mailman/listinfo/python-list