When implementing Python 2 and Python 3 compatibility in a single code base, division won’t truncate unless double slashes are used, or __future__ importation to division is done. All integers are long; there are no short integers because long() is gone; octal constants must start with 0o (zero-oh); and there are syntax changes to note in the integer inspection. Let’s discuss each of these in detail.
Inspecting Integers
In Python 3, there are no long integers; therefore, integer types are checked against type int; for example:
Download Numbers/inspectionpy3.py
y = 3
if isinstance(y, int):