Ben Finney <ben+pyt...@benfinney.id.au> writes:
> The ‘cmp’ implementation must decide *at least* between three
> conditions...  The implementation of ‘__lt__’ and the implementation
> of ‘__eq__’ each only need to decide two conditions (true, false).

> If you're saying the latter implementation is somehow *more* expensive
> than the former, I think the implementations are suspect

What is suspect?  It seems natural to be able to distinguish the 3 cases
faster than two separate 2-case comparisons.  The most obvious example
is comparing long strings by scanning left to right.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to