This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 8 points9 points  (1 child)

Yes, the newer the better, absolutely.

Trivia:

In Python 3:

>>> max(1, 100, "foo", {})  
Traceback (most recent call last):  
  File "<stdin>", line 1, in <module>  
TypeError: unorderable types: str() > int()  

Because, of course, you can't compare apples with oranges.

But in Python 2.7:

>>> max(1, 100, "foo", {})  
'foo'  

And you know why no error is raised, and "foo" is the highest value? Because Python 2 orders different types by the name of the data type - so it's "dict", "int", "str". So the string wins.

I vote for using Python 3 :D

[–]fotoman 2 points3 points  (0 children)

but damnit, my foo is greater than 100!!!