Jump to content

Welcome, Guest!

Sign in to follow this  
zag

Python v2 vs. Python v3

Recommended Posts

Short version: Python 2.x is the status quo, Python 3.x is the present and future of the language

 

Guido van Rossum (the original creator of the Python language) decided to clean up Python 2.x properly, with less regard for backwards compatibility than is the case for new releases in the 2.x range. The most drastic improvement is the better unicode support (with all text strings being unicode by default) as well as saner bytes/unicode separation.

 

Besides, several aspects of the core language (such as print and exec being statements, integers using floor division) have been adjusted to be easier for newcomers to learn and to be more consistent with the rest of the language, and old cruft has been removed (for example, all classes are now new-style, range() returns a memory efficient iterable, not a list as in 2.x).

 

The What's New in Python 3.0 document provides a good overview of the major language changes and likely sources of incompatibility with existing Python 2.x code.

 

However, the broader Python ecosystem has amassed a significant amount of quality software over the years. The downside of breaking backwards compatibility in 3.x is that a lot of that software doesn't work on 3.x yet.

 

More on the official Python Wiki

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

About Us

Bringing you the latest Raspberry Pi news, tutorials and user forum.

The Fruity Computer

×