int and long were "unified" a few versions back. Before that it was possible to overflow an int through math ops.

3.x has further advanced this by eliminating long altogether and only having int.

  • Python 2: sys.maxint contains the maximum value a Python int can hold.
    • On a 64-bit Python 2.7, the size is 24 bytes. Check with sys.getsizeof().
  • Python 3: sys.maxsize contains the maximum size in bytes a Python int can be.
    • This will be gigabytes in 32 bits, and exabytes in 64 bits.
    • Such a large int would have a value similar to 8 to the power of sys.maxsize.
Answer from Ignacio Vazquez-Abrams on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_numbers.asp
Python Numbers
Python Examples Python Compiler ... Certificate Python Training ... Int, or integer, is a whole number, positive or negative, without decimals, of unlimited length....
๐ŸŒ
Mimo
mimo.org โ€บ glossary โ€บ python โ€บ integer
Python Integer: Master Numeric Data Types
Integer, or int, is a data type in Python that represents whole numbers without a decimal point.
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ library โ€บ stdtypes.html
Built-in Types โ€” Python 3.14.3 documentation
February 25, 2026 - Deprecated since version 3.12: The use of the bitwise inversion operator ~ is deprecated and will raise an error in Python 3.16. bool is a subclass of int (see Numeric Types โ€” int, float, complex). In many numeric contexts, False and True behave like the integers 0 and 1, respectively.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-int-function
Python int() Function - GeeksforGeeks
September 26, 2025 - The Python int() function converts a given object to an integer or converts a decimal (floating-point) number to its integer part by truncating the fractional part.
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ methods โ€บ built-in โ€บ int
Python int() (With Examples)
Become a certified Python programmer. Try Programiz PRO! ... The int() function converts a number or a string to its equivalent integer.
๐ŸŒ
Tutorial Teacher
tutorialsteacher.com โ€บ python โ€บ python-number-type
Python Numbers: int, float, complex (With Examples)
In Python, integers are zero, positive or negative whole numbers without a fractional part and having unlimited precision, e.g. 0, 100, -10.
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ c-api โ€บ long.html
Integer Objects โ€” Python 3.14.3 documentation
February 24, 2026 - All integers are implemented as โ€œlongโ€ integer objects of arbitrary size. On error, most PyLong_As* APIs return(return type)-1 which cannot be distinguished from a number. Use PyErr_Occurred() to d...
Find elsewhere
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ ref_func_int.asp
Python int() Function
Python Examples Python Compiler ... Q&A Python Bootcamp Python Certificate Python Training ... The int() function converts the specified value into an integer number....
๐ŸŒ
Python Reference
python-reference.readthedocs.io โ€บ en โ€บ latest โ€บ docs โ€บ ints
int โ€” Python Reference (The Right Way) 0.1 documentation
Numbers are created by numeric literals or as the result of built-in functions and operators. Unadorned integer literals (including binary, hex, and octal numbers) yield plain integers unless the value they denote is too large to be represented as a plain integer, in which case they yield a ...
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ python โ€บ python_numbers.htm
Python - Numbers
In Python, any number without the provision to store a fractional part is an integer. (Note that if the fractional part in a number is 0, it doesn't mean that it is an integer. For example a number 10.0 is not an integer, it is a float with ...
๐ŸŒ
Real Python
realpython.com โ€บ ref โ€บ builtin-types โ€บ int
int | Pythonโ€™s Built-in Data Types โ€“ Real Python
The built-in int data type represents integer numbers, which are whole numbers without any decimal places. Integers can be positive, negative, or zero.
๐ŸŒ
Python
peps.python.org โ€บ pep-0237
PEP 237 โ€“ Unifying Long Integers and Integers | peps.python.org
February 1, 2025 - Python currently distinguishes between two kinds of integers (ints): regular or short ints, limited by the size of a C long (typically 32 or 64 bits), and long ints, which are limited only by available memory.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ gloss_python_int.asp
Python Int
Python Examples Python Compiler ... Certificate Python Training ... Int, or integer, is a whole number, positive or negative, without decimals, of unlimited length....
๐ŸŒ
Learn Python
learnpython.org โ€บ en โ€บ Variables_and_Types
Variables and Types - Learn Python - Free Interactive Python Tutorial
Python supports two types of numbers - integers(whole numbers) and floating point numbers(decimals).
๐ŸŒ
Kansas State University
textbooks.cs.ksu.edu โ€บ intro-python โ€บ 02-numbers โ€บ 01-integers
Integers :: Introduction to Python
June 27, 2024 - In mathematics, an integer is a whole number, such as $ 3 $, $ -5 $, or even $ 0 $. Basically, any positive or negative number that doesnโ€™t include a fractional or decimal portion is a whole number, and therefore it is an integer. In Python, those numbers can be stored in the int data type.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-numbers
Python Numbers - GeeksforGeeks
July 15, 2025 - In Python, there is no limit to how long an integer value can be.
๐ŸŒ
Tenthousandmeters
tenthousandmeters.com โ€บ blog โ€บ python-behind-the-scenes-8-how-python-integers-work
Python behind the scenes #8: how Python integers work
February 8, 2021 - Integers require no introduction. They are so ubiquitous and seem so basic that you may doubt whether it's worth discussing how they are implemented at all. Yet, Python integers are interesting because they are not just 32-bit or 64-bit integers that CPUs work with natively.