Booleans and comparison results

Roman Suzi rnd at
Tue Jun 24 17:19:28 CEST 2003

Just a thought. Why cmp() returns -1,0,1 while comparison
results are False and True? Isn't it logical step to add
Less, Equal and More?

>>> cmp(1,2)
>>> cmp(1,-1)
>>> cmp(1,1)

if cmp(foo, bar) is Less:

hmmm... Sadly, I know GvR is not going to add new keyword:

if cmp(foo, bar) are Equal:


Sincerely yours, Roman Suzi
rnd at =\= My AI powered by GNU/Linux RedHat 7.3

More information about the Python-list mailing list