content_image/692388.jpg
... >>> foo.__doc__ is None True 

(continued from previous page) 

See also PEP 498 for the proposal that added formatted string literals, and str.format() , which uses a related format string mechanism. 

## 2.4.4 Numeric literals 

There are three types of numeric literals: integers, floating point numbers, and imaginary numbers. There are no complex literals (complex numbers can be formed by adding a real number and an imaginary number). 

Note that numeric literals do not include a sign; a phrase like -1 is actually an expression composed of the unary operator ‘$_{-}$ ‘ and the literal$_{1}$ . 

## 2.4.5 Integer literals 

Integer literals are described by the following lexical definitions: 

<img src='content_image/692388.jpg'>

There is no limit for the length of integer literals apart from what can be stored in available memory. 

Underscores are ignored for determining the numeric value of the literal. They can be used to group digits for enhanced readability. One underscore can occur between digits, and after base specifiers like$_{0x}$ . 

Note that leading zeros in a non-zero decimal number are not allowed. This is for disambiguation with C-style octal literals, which Python used before version 3.0. 

Some examples of integer literals: 

7 2147483647 0o177 0b100110111 3 79228162514264337593543950336 0o377 0xdeadbeef 100_000_000_000 0b_1110_0101 

Changed in version 3.6: Underscores are now allowed for grouping purposes in literals. 

