0
Why is the magic method __gt__ not necessary?
2 Antworten
+ 2
lt gets called on the second instance:
https://code.sololearn.com/cccdQwPhYe57/?ref=app
Test it first without changing the code. Then it just calls gt on a1 but if you comment out gt it calls lt on a2!
0
Because you can just ask for lower and equal, and if it's neither, it has to be greater.