diff --git a/special-method-names.html b/special-method-names.html index b5eb365..174552f 100644 --- a/special-method-names.html +++ b/special-method-names.html @@ -670,6 +670,10 @@ class FieldStorage:
x.__bool__()
+++☞If you define a
__lt__()method but no__gt__()method, Python will use the__lt__()method with operands swapped. However, Python will not combine methods. For example, if you define a__lt__()method and a__eq()__method and try to test whetherx <= y, Python will not call__lt__()and__eq()__in sequence. It will only call the__le__()method. +