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


Groups > comp.lang.python > #36415

Re: comparison between non-comparable objects

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.109.133.81.MISMATCH!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.053
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'raises': 0.07; 'python': 0.09; 'section,': 0.09; 'sentence': 0.09; 'language': 0.14; 'source,': 0.15; 'bullet': 0.16; 'considers': 0.16; 'subject:between': 0.16; 'subject:non': 0.16; 'wrote:': 0.17; 'comparing': 0.17; 'earlier': 0.21; 'context.': 0.22; 'seems': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'correct': 0.28; 'quoting': 0.29; 'objects': 0.29; 'link.': 0.30; 'implement': 0.32; 'url:python': 0.32; 'to:addr :python-list': 0.33; 'another': 0.33; 'built-in': 0.35; 'there': 0.35; 'but': 0.36; 'url:org': 0.36; 'smaller': 0.36; 'url:library': 0.36; 'does': 0.37; 'two': 0.37; 'being': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'some': 0.38; 'url:docs': 0.38; 'page': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'subject:-': 0.40; 'your': 0.60; 'most': 0.61; 'different': 0.63; 'header:Reply-To:1': 0.68; 'online': 0.70; 'received:74.208': 0.71; 'url:htm': 0.71; 'reply- to:no real name:2**0': 0.72; '.....': 0.75; 'received:74.208.4.194': 0.84; 'url:reference': 0.84
Date Tue, 08 Jan 2013 01:03:30 -0500
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1
MIME-Version 1.0
To python-list@python.org
Subject Re: comparison between non-comparable objects
References <1357622887.2914.29.camel@qm>
In-Reply-To <1357622887.2914.29.camel@qm>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:3occT5FbtAzKpEAL4EfpzTEeSwmVCdLNCzd9oKopFTu jSxeOAxBS4ZNBlamtbqxHpIktMk60V8KSUiJLteagARwJgZi1Q NQzo0DIhBOqwyo4gb65wir5/okH7Iu41AFoGk0S3zGIU1gWzLc 3KKZixBsiFJQXQbhPTJ4Nu+1MUR6IqiLE/JG2q0Sko6OltHUX6 6x2CIvoZwohmesgDA6gYWzAtshxm5LCa7bFqxz2TnNguM8QSht EwZhsWMYlIWrYITJfZ60siCKshEczFmy5sGFyjRH4o/xbYbcIy MlxR31GkS75v2VBHgT9IjuFyCUhOUOtTUQZb6f1Bvem7QTk/A= =
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To d@davea.name
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.262.1357625026.2939.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1357625026 news.xs4all.nl 6870 [2001:888:2000:d::a6]:35650
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36415

Show key headers only | View raw


On 01/08/2013 12:28 AM, Kelvin Li wrote:
> The language reference says:
>
> "...the choice whether one object [of built-in type] is considered
> smaller or larger than another one is made arbitrarily..."

When quoting some online source, please give a reference link. It took
me a while to find the following page with your quote in it:


http://docs.python.org/3.3/reference/expressions.html
<http://docs.python.org/3.3/reference/expressions.htm>
   in section "6.9  Comparisons"

> but that seems to be Python 2 behavior; Python 3 apparently raises a
> TypeError. Does the documentation need updating?
>

That sentence is correct in context.  The bullet items there are labeled
"Comparison of objects of the same type..."  And the particular bullet
also qualifies the type of the two objects being compared:   " Most
other objects of built-in types..."



Earlier in the same section, it considers the case of comparing objects
of DIFFERENT type.

.... while the <, >, >= and <= operators raise a TypeError
<http://docs.python.org/3.3/library/exceptions.html#TypeError> when
comparing objects of different types that do not implement these
operators for the given pair of types....


-- 

DaveA

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


Thread

Re: comparison between non-comparable objects Dave Angel <d@davea.name> - 2013-01-08 01:03 -0500

csiph-web