You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
26 lines
295 B
Python
26 lines
295 B
Python
|
|
# 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())
|