Re: comparison between non-comparable objects

Discussion in 'Python' started by Kelvin Li, Jan 8, 2013.

  1. Kelvin Li

    Kelvin Li Guest

    > 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"


    Sorry about that. Thanks for finding the link.

    > > 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..."


    Got it, I was confusing built-in types with built-in functions--I
    incorrectly thought object(), for example, returned an object of a
    built-in type, and was behaving differently in Python 2 and 3:

    object() < object()

    Thanks,
    Kelvin
     
    Kelvin Li, Jan 8, 2013
    #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. Replies:
    5
    Views:
    6,894
  2. shawn

    comparable objects

    shawn, Mar 5, 2006, in forum: Java
    Replies:
    2
    Views:
    343
    shawn
    Mar 5, 2006
  3. vk
    Replies:
    16
    Views:
    1,825
    Alf P. Steinbach
    Feb 9, 2009
  4. Kelvin Li
    Replies:
    0
    Views:
    123
    Kelvin Li
    Jan 8, 2013
  5. Dave Angel
    Replies:
    0
    Views:
    115
    Dave Angel
    Jan 8, 2013
Loading...

Share This Page