Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106742 > unrolled thread

Re: how to convert code that uses cmp to python3

Started byRandom832 <random832@fastmail.com>
First post2016-04-09 11:59 -0400
Last post2016-04-09 11:59 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: how to convert code that uses cmp to python3 Random832 <random832@fastmail.com> - 2016-04-09 11:59 -0400

#106742 — Re: how to convert code that uses cmp to python3

FromRandom832 <random832@fastmail.com>
Date2016-04-09 11:59 -0400
SubjectRe: how to convert code that uses cmp to python3
Message-ID<mailman.127.1460217573.2253.python-list@python.org>
On Sat, Apr 9, 2016, at 07:49, Ben Finney wrote:
> I find that a dubious claim.
> 
> The ‘cmp’ implementation must decide *at least* between three
> conditions: less-than, equal-to, greater-than. That is *at least* two
> inflection points.

Yes, but in a sequence it can decide that at each element, and only has
to reach the end of the list in the (relatively rare) case that they're
equal. For that matter, it only has to determine less than vs greater
than for the first unequal element.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web