2010-08-26

What will forever be exclusive to Python 3?

[2010-08-26: remove PEP 3109 and 3110 as they are both syntactically supported in Python 2.6
 2010-09-01: remove mention of built-ins returning iterators]

A question on Stack Overflow about what is exclusive to Python 3 came up and I realized that there is no clear list of big changes that you cannot access in Python 2.7 through a __future__ import. So I figured I would go through the What's New docs for Python 3.0, 3.1, and 3.2a1 (although the What's New doc has not been written yet) and see what has (not) been backported of significance.

If something is available in Python 2.6 without a __future__ import I will not list it here (e.g., new octal literals, bytes literal, and str.format). I also don't touch the C API. Otherwise stuff that is crossed out has been backported in Python 2.7 or is in Python 2.6 with a __future__ import. Everything else you have to make the switch to Python 3 to get the feature.

So what does the list tell us? First, a ton of syntactic cleanup only appears in Python 3, which is not surprising. Second, there are still plenty of reasons, both from a development perspective but also a performance one, to look forward to moving over to Python 3 when you can.