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


Groups > comp.lang.python > #6842

Re: Comparison operators in Python

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'guido': 0.04; 'subject:Python': 0.06; 'terry': 0.07; 'python': 0.08; '3.x': 0.09; 'comparisons': 0.09; 'deprecated': 0.09; 'kelly': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'pm,': 0.10; '>>>': 0.12; 'broken': 0.14; 'wrote:': 0.14; '(excluding': 0.16; 'integer.': 0.16; 'permitted.': 0.16; 'rationale': 0.16; 'reedy': 0.16; 'sorting': 0.16; 'compatible': 0.16; 'before.': 0.19; 'jan': 0.20; 'header:In-Reply-To:1': 0.21; 'seems': 0.21; 'wrote': 0.22; 'integer': 0.23; 'string': 0.26; 'fixed': 0.27; 'example': 0.27; 'ago': 0.31; 'print': 0.31; 'header:X-Complaints-To:1': 0.32; 'to:addr:python-list': 0.33; 'generally': 0.33; 'things': 0.33; 'there': 0.35; 'header:User-Agent:1': 0.35; 'idea': 0.36; 'change': 0.37; 'another': 0.37; 'received:org': 0.38; 'subject:: ': 0.38; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'allows': 0.40; 'more': 0.60; 'viewed': 0.82; '1/2': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Comparison operators in Python
Date Thu, 02 Jun 2011 02:09:11 -0400
References <0dda7cc8-e1c0-409d-b993-b8aec379f7bd@hd10g2000vbb.googlegroups.com> <mailman.2378.1306955816.9059.python-list@python.org> <62BFp.19321$pi2.14587@newsfe11.iad>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host rain.gmane.org
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10
In-Reply-To <62BFp.19321$pi2.14587@newsfe11.iad>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2382.1306994970.9059.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 82.94.164.166
X-Trace 1306994971 news.xs4all.nl 49177 [::ffff:82.94.164.166]:55789
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:6842

Show key headers only | View raw


On 6/1/2011 8:44 PM, harrismh777 wrote:
> Ian Kelly wrote:

 >> ?? wrote
>>> integer. However comparison between a string and an integer seems to
>>> be permitted. Is there any rationale behind this ?

>> It allows things like sorting of heterogeneous lists. It's generally
>> viewed as a wart, though, and it was fixed in Python 3:

This was a Python 1.0 idea that Guido decided was more bug-inducing than 
useful.

> Just another example (excluding print 1/2 and unicode) where 3.x seems
> to be completely compatible with 2.x/ (tongue-in-cheek)

Arbitrary comparisons were broken and effectively deprecated about a 
decade ago with the introduction of the complex type. Just another 
example where 3.x completes a process of change started years before.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Comparison operators in Python Anirudh Sivaraman <sk.anirudh@gmail.com> - 2011-06-01 11:50 -0700
  Re: Comparison operators in Python Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2011-06-01 22:08 +0300
  Re: Comparison operators in Python Ian Kelly <ian.g.kelly@gmail.com> - 2011-06-01 13:16 -0600
    Re: Comparison operators in Python harrismh777 <harrismh777@charter.net> - 2011-06-01 19:44 -0500
      Re: Comparison operators in Python Terry Reedy <tjreedy@udel.edu> - 2011-06-02 02:09 -0400
      Re: Comparison operators in Python Michael Sparks <sparks.m@gmail.com> - 2011-06-02 03:05 -0700

csiph-web