Other changes

We cannot possibly fit all the Python 3 changes and improvements into this appendix. However, the other commonly cited changes are as follows:

  1. print() is now a function: Previously it was a statement, that is, arguments were not in parentheses
  2. Integers don't overflow: sys.maxint is outdated; integers will have unlimited precision
  3. Inequality operator <> is removed: Use != instead
  1. True Integer Division: In Python 2, 3/2 would evaluate to 1. It will be correctly evaluated to 1.5 in Python 3
  2. Use range instead of xrange: range() will now return iterators, as xrange() used to work before
  3. Dictionary keys are views: dict and dict-like classes (such as QueryDict) will return iterators instead of lists for keys(), items(), and values() ...

Get Django Design Patterns and Best Practices - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.