Skip to content

Commit 819380c

Browse files
committed
tests/basics: Add test for tuple compare with class derived from tuple.
Only the "==" operator was tested by the test suite in for such arguments. Other comparison operators like "<" take a different path in the code so need to be tested separately.
1 parent a636837 commit 819380c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/basics/subclass_native_cmp.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ class mytuple(tuple):
77
print(t)
88
print(t == (1, 2, 3))
99
print((1, 2, 3) == t)
10+
11+
print(t < (1, 2, 3), t < (1, 2, 4))
12+
print((1, 2, 3) <= t, (1, 2, 4) < t)

0 commit comments

Comments
 (0)