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
aa0a0b90
Commit
aa0a0b90
authored
Apr 11, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix markup
parent
e753abde
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
Doc/whatsnew/2.7.rst
Doc/whatsnew/2.7.rst
+9
-10
No files found.
Doc/whatsnew/2.7.rst
View file @
aa0a0b90
...
...
@@ -88,22 +88,21 @@ Other Language Changes
Some smaller changes made to the core Python language are:
*
The string :method:`format` method now supports automatic numbering
of the replacement fields. This makes using :meth:`format`
more closely resemble using
``%s`` formatting::
*
:meth:`str.format` method now supports automatic numbering of the replacement
fields. This makes using :meth:`str.format` more closely resemble using
``%s`` formatting::
>>> '{}:{}:{}'.format(2009, 04, 'Sunday')
'2009:4:Sunday'
>>> '{}:{}:{day}'.format(2009, 4, day='Sunday')
'2009:4:Sunday'
The auto-numbering takes the fields from left to right, so the first
``{...}`` specifier will use the first argument to :meth:`format`,
the next specifier will use the next argument, and so on. You can't
mix auto-numbering and explicit numbering -- either number all of
your specifier fields or none of them -- but you can mix
auto-numbering and named fields, as in the second example above.
(Contributed by XXX; :issue`5237`.)
The auto-numbering takes the fields from left to right, so the first ``{...}``
specifier will use the first argument to :meth:`str.format`, the next
specifier will use the next argument, and so on. You can't mix auto-numbering
and explicit numbering -- either number all of your specifier fields or none
of them -- but you can mix auto-numbering and named fields, as in the second
example above. (Contributed by XXX; :issue`5237`.)
* The :func:`int` and :func:`long` types gained a ``bit_length``
method that returns the number of bits necessary to represent
...
...
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