Re: Booleans and comparison results

Discussion in 'Python' started by Gerrit Holl, Jun 24, 2003.

  1. Gerrit Holl

    Gerrit Holl Guest

    Roman Suzi wrote:
    > 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


    Well, "Less" is not always the right term:

    cmp("", " ")

    Is "" less than " "? I don't think so: I think that for non-numbers, "Less"
    and "More" may be misleading/incorrect. I like the idea though ;)

    > =\= My AI powered by GNU/Linux RedHat 7.3


    17:26:55:2:gerrit@stopcontact:~$ cat /etc/redhat-release
    Red Hat Linux release 9 (Shrike)

    Gerrit.

    --
    7. If any one buy from the son or the slave of another man, without
    witnesses or a contract, silver or gold, a male or female slave, an ox or
    a sheep, an ass or anything, or if he take it in charge, he is considered
    a thief and shall be put to death.
    -- 1780 BC, Hammurabi, Code of Law
    --
    Asperger Syndroom - een persoonlijke benadering:
    http://people.nl.linux.org/~gerrit/
    Het zijn tijden om je zelf met politiek te bemoeien:
    http://www.sp.nl/
    Gerrit Holl, Jun 24, 2003
    #1
    1. Advertising

  2. Gerrit Holl wrote:
    > Is "" less than " "? I don't think so: I think that for non-numbers, "Less"
    > and "More" may be misleading/incorrect. I like the idea though ;)


    Maybe "Before" and "After"?

    Or "Preceding" and... er... um... "Postceding"?

    --
    Greg Ewing, Computer Science Dept,
    University of Canterbury,
    Christchurch, New Zealand
    http://www.cosc.canterbury.ac.nz/~greg
    Greg Ewing (using news.cis.dfn.de), Jun 25, 2003
    #2
    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. Roman Suzi

    Booleans and comparison results

    Roman Suzi, Jun 24, 2003, in forum: Python
    Replies:
    0
    Views:
    710
    Roman Suzi
    Jun 24, 2003
  2. =?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:
    697
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Jun 24, 2003
  3. Ryszard Szopa
    Replies:
    2
    Views:
    280
    Terry Reedy
    Jan 31, 2008
  4. Dr. Know

    OLE JET and Booleans

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

Share This Page