diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-09-06 00:23:41 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-09-06 00:23:41 +0300 |
commit | 1aaba5cabe48fa5168279a51f62124bbfedd5d59 (patch) | |
tree | ddacb8ac83b55e5a0c5c54cc42d4870cd4f07878 /tests/basics/tuple_compare.py | |
parent | e354b0a0cbfc1718ceea848b140fb905ce509103 (diff) | |
download | micropython-1aaba5cabe48fa5168279a51f62124bbfedd5d59.tar.gz micropython-1aaba5cabe48fa5168279a51f62124bbfedd5d59.zip |
py/objtuple: Properly implement comparison with incompatible types.
Should raise TypeError, unless it's (in)equality comparison.
Diffstat (limited to 'tests/basics/tuple_compare.py')
-rw-r--r-- | tests/basics/tuple_compare.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/basics/tuple_compare.py b/tests/basics/tuple_compare.py index ad813f7029..9558eb1db4 100644 --- a/tests/basics/tuple_compare.py +++ b/tests/basics/tuple_compare.py @@ -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") |