The behaviour for strings should be as per the existing string comparisons. Anything else would be surprising.On 05/07/2020 23:55, Rob Cliffe wrote:
I don't think the new function should be restricted to numbers. There may be uses for strings, or for user-built classes; why restrict it unnecessarily?
If it quacks like supporting __lt__ and __gt__, it's a duck.
I'm not opposed to this, although the semantics of calling it with strings may not be intuitive (does it compare the length? Alphabetic order? What order is respected for CJK or symbols?); on the other hand, we already have such behaviour on min() and max() so adding it to clamp() should reasonably be expected to follow the same logic.