Booleans and comparison results

Discussion in 'Python' started by Roman Suzi, Jun 24, 2003.

  1. Roman Suzi

    Roman Suzi Guest

    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)

    Less
    >>> cmp(1,-1)

    More
    >>> cmp(1,1)

    Equal


    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
    --
    =\= My AI powered by GNU/Linux RedHat 7.3
    Roman Suzi, Jun 24, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?Gerhard_H=E4ring?=

    Re: Booleans and comparison results

    =?ISO-8859-1?Q?Gerhard_H=E4ring?=, Jun 24, 2003, in forum: Python
    Replies:
    0
    Views:
    684
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Jun 24, 2003
  2. Gerrit Holl

    Re: Booleans and comparison results

    Gerrit Holl, Jun 24, 2003, in forum: Python
    Replies:
    1
    Views:
    650
    Greg Ewing (using news.cis.dfn.de)
    Jun 25, 2003
  3. Ryszard Szopa
    Replies:
    2
    Views:
    274
    Terry Reedy
    Jan 31, 2008
  4. Dr. Know

    OLE JET and Booleans

    Dr. Know, Jan 6, 2005, in forum: ASP General
    Replies:
    4
    Views:
    180
    Dr. Know
    Jan 7, 2005
  5. Deepu
    Replies:
    1
    Views:
    217
    ccc31807
    Feb 7, 2011
Loading...

Share This Page