Python 3.0, 'Hello' < 42

Discussion in 'Python' started by towitowi, Jan 28, 2009.

  1. towitowi

    towitowi Guest


    In the 3.0 changes list there is mentioned that "<"-compares are not
    supported anymore if the compared types are different (except
    numbers). Like
    42 < "Hello"
    did return True of False depending on the implementation but is now a

    But the document also mentions that the result is not strictly
    "undefined" but "reproducable undetermined". Meaning, that on a given
    machine with a given python implementation result will always be the
    same. But on another machine, or with another python implementation,
    it might give a different result.

    My question now is, why this is? E.g, Is there an integer large enough
    so that the result changes? What circumstances influence the result?

    Thanks in advance.

    tschau, towi.
    towitowi, Jan 28, 2009
    1. Advertisements

  2. But the document also mentions that the result is not strictly
    What specific document are you looking at, and where specifically
    does it say that? I can't believe that the quotation marks indicate
    an actual quote, in particular because "reproducible" is misspelled.

    In any case, I can't find anything like that in the 3.0 changes
    document, and, given that the comparison *does* give an exception,
    any statement that the result is undetermined would be false.

    Martin v. Löwis, Jan 28, 2009
    1. Advertisements

  3. towitowi

    Terry Reedy Guest

    I believe there was something like that in the 2.x docs but nothing in
    the Expressions / Comparisons section of 3.0.
    Terry Reedy, Jan 28, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.