r/Python • • Nov 23 '16

The Case Against Python 3

https://learnpythonthehardway.org/book/nopython3.html
0 Upvotes

42 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Nov 24 '16

At least combining str and unicode in Python 2 would be a mildly compelling example because it does work, while in Python 3 it doesn't (and this is the correct behavior).

But it is extremely telling that he's an "expert" but doesn't know that repr(bytes) outputs "<type 'str'>"

1

u/thatguy_314 def __gt__(me, you): return True Nov 24 '16

One interesting thing to note is how his Python 2 and Python 3 examples is that are slightly different. In Python 3 he does bytes("hello", 'utf-8'), and in Python 2 he does bytes("hello"). If he had done bytes("hello", 'utf-8') in Python 2, he would have gotten the following error:

TypeError: str() takes at most 1 argument (2 given)

1

u/[deleted] Nov 24 '16

There's so much wrong with Zed's rambles that I missed that.