Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e5e728ba
Commit
e5e728ba
authored
14 years ago
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New string format character.
parent
d8fae4e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
Doc/whatsnew/3.2.rst
Doc/whatsnew/3.2.rst
+14
-1
No files found.
Doc/whatsnew/3.2.rst
View file @
e5e728ba
...
...
@@ -315,7 +315,20 @@ Some smaller changes made to the core Python language are:
>>> short.untransform('zlib_codec')
b'which witch had which witches wrist watch'
(From multiple contributers in :issue:`7475`.)
(From multiple contributors in :issue:`7475`.)
* String formatting for :func:`format` and :meth:`str.format` gained a new format
character **#**. For integers in binary, octal, or hexadecimal, it causes
the output to be prefixed with '0b', '0o', or '0x' respectively. For floats,
complex, and Decimal, it causes the output to always have a decimal point
even when no digits follow it.
>>> format(20, '#o')
'0o24'
>>> format(12.34, '#5.0f')
' 12.'
(Suggested by Mark Dickinson and implemented by Eric Smith in :issue:`7094`.)
* The interpreter can now be started with a quiet option, ``-q``, to suppress
the copyright and version information in an interactive mode.
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment