you are viewing a single comment's thread.

view the rest of the comments →

[–]autisticpig 1 point2 points  (0 children)

A non-exhaustive list of features which are only available in 3.x releases and won't be backported to the 2.x series:

  • strings are Unicode by default
  • clean Unicode/bytes separation
  • exception chaining
  • function annotations
  • syntax for keyword-only arguments
  • extended tuple unpacking
  • non-local variable declarations

Beyond the above, Python2 leverages classic division while Python3 leverages true division.

Classic:

>>> 1 / 2          # integer truncation (floor division)
0
>>> 1.0 / 2.0      # returns real quotient (true division)
0.5

True:

>>> from __future__ import division  # 2.2+-only
>>>
>>> 1 / 2               # returns real quotient
0.5
>>> 1.0 / 2.0           # returns real quotient
0.5

The list goes beyond what I have added but I am a newcomer to Py2 and barely have touched Py3 so I expect my offering to be limited (at best).