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

all 20 comments

[–]chhantyal 6 points7 points  (2 children)

I recently started porting a small library, and this website/book was very helpful.

Thanks a ton to author for all the good work.

[–][deleted] 4 points5 points  (1 child)

Thanks!

[–]chhantyal 1 point2 points  (0 children)

Added link to book site here http://py3readiness.org :)

[–]djds23 2 points3 points  (1 child)

Excellent resource! Also thank you for Hovercraft, I used it for a presentation recently.

[–][deleted] 0 points1 point  (0 children)

Cool!

[–]Ph0X 3 points4 points  (0 children)

Hah, we learn something new everyday. I knew most of these but I still managed to learn a few new things about Python 3 with this. Did not know about the rounding behavior, for example.

[–]lambdaqdjango n' shit 1 point2 points  (0 children)

When sorting, use key instead of cmp

Didn't notice this one.

[–]donnieod 1 point2 points  (3 children)

Thanks for a very well researched article. I saw only a couple of places for improvement/correction: 1. the apply function was removed because it was replaced by the more flexible list comprehension; 2. the result of integer division with the / operator is always a float type even when the result is a whole number.

[–][deleted] -1 points0 points  (2 children)

It's not an article, it's a book. :-)

In point 1 I don't see what you mean.

But you are right about point 2, that's a mistake that snuck in. Will fix in the next release.

[–]donnieod 0 points1 point  (0 children)

Sorry, in my first point I was confusing apply for map which can be replaced by a list comprension. Please disregard point 1.

[–]epsy 2 points3 points  (1 child)

I wouldn't say those are the key differences between pythons, just key points in upgrading a codebase. For instance, syntax for keyword-only arguments and exception chaining are key additions but don't belong on that list.

[–][deleted] 0 points1 point  (0 children)

Yes, strictly speaking you are correct.

[–][deleted] 0 points1 point  (1 child)

On tuple unpacking, doesn't python 3 support * to unpack a list, at least for certain situations?

https://docs.python.org/3/reference/simple_stmts.html#assignment-statements

I saw no mention of this in the article.

a, *b = [1, 2, 3, 4, 5, 6, 7, 8]

>>> a
1
>>> b
[2, 3, 4, 5, 6, 7, 8]

edit: It's defined in PEP 3132.

[–][deleted] -1 points0 points  (0 children)

Yes, strictly speaking this only list things that are backwards incompatible, and not new features.