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