@@ -12,8 +12,12 @@ def __repr__(self):
12
12
return 'Point({!r:},{!r:},{!r:},{!r:})' .format (self .a , self .b , self .c , self .d )
13
13
def __lt__ (self , other ):
14
14
return (self .a < other .a if self .a != other .a else (self .b < other .b if self .b != other .b else (self .c < other .c if self .c != other .c else self .d < other .d )))
15
+ def __le__ (self , other ):
16
+ return (self .a , self .b , self .c , self .d ) <= (other .a , other .b , other .c , other .d )
15
17
def __gt__ (self , other ):
16
18
return (self .a > other .a if self .a != other .a else (self .b > other .b if self .b != other .b else (self .c > other .c if self .c != other .c else self .d > other .d )))
19
+ def __ge__ (self , other ):
20
+ return (self .a , self .b , self .c , self .d ) >= (other .a , other .b , other .c , other .d )
17
21
def __eq__ (self , other ):
18
22
return self .a == other .a and self .b == other .b and self .c == other .c and self .d == other .d
19
23
def distance (self , a , b , c , d ):
@@ -32,5 +36,5 @@ def distance(self, a, b, c, d):
32
36
]
33
37
34
38
print (sortingx .heap (points , key = methodcaller ('distance' , 0 , 0 , 0 , 0 )))
35
- # print(sortingx.heap (points))
36
- # print(sortingx.heap (points, reverse=True))
39
+ # print(sortingx.insert (points))
40
+ # print(sortingx.insert (points, reverse=True))
0 commit comments