Python - Numeric Integers

Integers in Python 2.X: normal and long

In Python 2.X there are two integer types, normal (often 32 bits) and long (unlimited precision).

An integer may end in an l or L to force it to become a long integer.

Because integers are automatically converted to long integers when their values overflow their allocated bits, you never need to type the letter L yourself.

Python automatically converts up to long integer when extra precision is needed.

Integers in Python 3.X: a single type

In Python 3.X, the normal and long integer types have been merged.

Python 3.X automatically supports the unlimited precision of Python 2.X's separate long integer type.

Because of this, integers can no longer be coded with a trailing l or L.

Related Topics