Python 3 syntax changes

So, my work, which used the older Python 2, does some updating of the code anyway, I'm just learning python and actually quite new to it here, but what are the main syntax changes that came from 2 -> 3

Or is there really even such a syntax change in general (for example, I know that the print has been changed, but what else is MAJOR)

thanks

+7
source share
4 answers

What's New in Python 3.0:
http://docs.python.org/release/3.0.1/whatsnew/3.0.html

PEP: 3000 - Python 3000:
http://www.python.org/dev/peps/pep-3000/

PEP: 3099 - Things that won't change in Python 3000:
http://www.python.org/dev/peps/pep-3099/

+10
source

Have you read this: Overview of syntax changes ?

+4
source

What you really notice in the syntax is the print statement and changing the syntax of the exception. 2to3 will handle it all.

This will not cause you any headaches. This usually comes from breaking strings into binary bytes and Unicode strings. 2to3 can't handle this.

So syntax changes are not something you need to worry about. :)

Then there are minor changes in the syntax, tons of small changes in various functions and a huge reorganization of the standard library, most of which is processed by 2to3.

There is no canonical summary of all afaik changes, although I tried to make one in my new book . There may be some misses, but there you go.

+4
source

You cannot do much better than reading the documentation: http://docs.python.org/release/3.1.2/whatsnew/ covers all the changes quite successfully. First, read the What's New in Python 3.0 section for major changes.

0
source

All Articles