You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
295 B
25 lines
295 B
# test equality for classes/instances to other types
|
|
|
|
class A:
|
|
pass
|
|
|
|
class B:
|
|
pass
|
|
|
|
class C(A):
|
|
pass
|
|
|
|
print(A == None)
|
|
print(None == A)
|
|
|
|
print(A == A)
|
|
print(A() == A)
|
|
print(A() == A())
|
|
|
|
print(A == B)
|
|
print(A() == B)
|
|
print(A() == B())
|
|
|
|
print(A == C)
|
|
print(A() == C)
|
|
print(A() == C())
|
|
|