summaryrefslogtreecommitdiffstatshomepage
path: root/tests/float/float_compare.py
blob: 105923ac733afa6e097253b1c07d6578e01e156b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Extended float comparisons

class Foo:
    pass

foo = Foo()

print(foo == 1.0)
print(1.0 == foo)
print(1.0 == Foo)
print(1.0 == [])
print(1.0 == {})

try:
    print(foo < 1.0)
except TypeError:
    print("TypeError")

try:
    print(1.0 < foo)
except TypeError:
    print("TypeError")