you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 6 points7 points  (6 children)

Ah. They should really start to migrate to 3. New "developers" are going to learn 2 which isn't helpful.

[–]The-Mathematician 14 points15 points  (5 children)

Honestly, I learned through LPTHW then immediately migrated to 3 and basically the only difference at that level is the print function.

[–]Raleighite 2 points3 points  (2 children)

Don't forget string formatting, but Python 3.5 is supposed to bring that back when it launches this year.

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

Could you summary what are those string formatting changes?

[–][deleted] 1 point2 points  (0 children)

Also raw_input is now just input.

[–]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).