Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Booleans and comparison results

Reply
Thread Tools

Re: Booleans and comparison results

 
 
Gerrit Holl
Guest
Posts: n/a
 
      06-24-2003
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

> http://www.velocityreviews.com/forums/(E-Mail Removed) =\= 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/

 
Reply With Quote
 
 
 
 
Greg Ewing (using news.cis.dfn.de)
Guest
Posts: n/a
 
      06-25-2003
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
booleans, hash() and objects having the same value Ryszard Szopa Python 2 01-31-2008 02:26 AM
array of booleans zeus2@hotmail.com Java 4 10-01-2005 05:29 PM
OLE JET and Booleans Dr. Know ASP General 4 01-07-2005 02:47 AM
Re: Booleans and comparison results =?ISO-8859-1?Q?Gerhard_H=E4ring?= Python 0 06-24-2003 03:49 PM
Booleans and comparison results Roman Suzi Python 0 06-24-2003 03:19 PM



Advertisments