Python 3.0, 'Hello' < 42

T

towitowi

Hello,

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

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

Martin v. Löwis

But the document also mentions that the result is not strictly
"undefined" but "reproducable undetermined".

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.

Regards,
Martin
 
T

Terry Reedy

Martin said:
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.

I believe there was something like that in the 2.x docs but nothing in
the Expressions / Comparisons section of 3.0.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top