Added '#' alternate formatting for integers. See issue 3138.
This commit is contained in:
parent
618b33c9e8
commit
3722b933b5
10
pep-3101.txt
10
pep-3101.txt
|
@ -8,7 +8,7 @@ Type: Standards Track
|
|||
Content-Type: text/plain
|
||||
Created: 16-Apr-2006
|
||||
Python-Version: 3.0
|
||||
Post-History: 28-Apr-2006, 6-May-2006, 10-Jun-2007, 14-Aug-2007
|
||||
Post-History: 28-Apr-2006, 6-May-2006, 10-Jun-2007, 14-Aug-2007, 14-Sep-2008
|
||||
|
||||
|
||||
Abstract
|
||||
|
@ -240,7 +240,7 @@ Standard Format Specifiers
|
|||
|
||||
The general form of a standard format specifier is:
|
||||
|
||||
[[fill]align][sign][0][minimumwidth][.precision][type]
|
||||
[[fill]align][sign][#][0][minimumwidth][.precision][type]
|
||||
|
||||
The brackets ([]) indicate an optional element.
|
||||
|
||||
|
@ -274,7 +274,11 @@ Standard Format Specifiers
|
|||
numbers (this is the default behavior)
|
||||
' ' - indicates that a leading space should be used on
|
||||
positive numbers
|
||||
|
||||
|
||||
If the '#' character is present, integers use the 'alternate form'
|
||||
for formatting. This means that binary, octal, and hexidecimal
|
||||
output will be prefixed with '0b', '0o', and '0x', respectively.
|
||||
|
||||
'width' is a decimal integer defining the minimum field width. If
|
||||
not specified, then the field width will be determined by the
|
||||
content.
|
||||
|
|
Loading…
Reference in New Issue