mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 04:30:24 +01:00
py/objtuple: Properly implement comparison with incompatible types.
Should raise TypeError, unless it's (in)equality comparison.
This commit is contained in:
@@ -53,3 +53,13 @@ print((10, 0) > (1, 1))
|
||||
print((10, 0) < (1, 1))
|
||||
print((0, 0, 10, 0) > (0, 0, 1, 1))
|
||||
print((0, 0, 10, 0) < (0, 0, 1, 1))
|
||||
|
||||
|
||||
print(() == {})
|
||||
print(() != {})
|
||||
print((1,) == [1])
|
||||
|
||||
try:
|
||||
print(() < {})
|
||||
except TypeError:
|
||||
print("TypeError")
|
||||
|
||||
Reference in New Issue
Block a user