-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-10379: deprecate locale.format in lieu of locale.format_string #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
d0f9863
820e289
4cfd737
a08419f
4e24a3f
6097e47
04577c2
2039406
5b100b8
041349f
795aa65
8190fa9
7e0bfcf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Fixed recommended CR changes
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
8000
|
@@ -371,12 +371,19 @@ The :mod:`locale` module defines the following exception and functions: | |
|
||
.. function:: format_string(format, val, grouping=False, monetary=False) | ||
|
||
Formats a number *val* according to the current :const:`LC_NUMERIC` setting. | ||
The format follows the conventions of the ``%`` operator. For floating point | ||
values, the decimal point is modified if appropriate. If *grouping* is true, | ||
also takes the grouping into account. | ||
|
||
If *monetary* is true, the conversion uses monetary thousands separator and | ||
grouping strings. | ||
|
||
Processes formatting specifiers as in ``format % val``, but takes the current | ||
locale settings into account. | ||
|
||
.. versionchanged:: 3.7 | ||
The *monetary* keyword parameter was added. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing indentation. |
||
Replaces :meth:`format`. | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The description of the monetary parameter should be added to the regular docs, and the version changed phrase should just say "the monetary keyword parameter was added" |
||
.. function:: currency(val, symbol=True, grouping=False, international=False) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,6 +158,11 @@ API and Feature Removals | |
Python 3.1, and has now been removed. Use the :func:`~os.path.splitdrive` | ||
function instead. | ||
|
||
* Deprecated :meth:`format` from :mod:`locale`, use the :meth:`format_string` | ||
instead. Added another argument *monetary* in :meth:`format_string` of | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. format hasn't been removed, so the deprecation should go in the deprecation section. The feature addition of the monetary keyword should go in the 'improved modules' section. |
||
:mod:`locale`. | ||
(Contributed by Garvit in :issue:`10379`.) | ||
|
||
|
||
Porting to Python 3.7 | ||
===================== | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need the description of the monetary keyword (presumably copy and pasted from the existing format entry) in the description of the format_string function.
In fact, what we really want to do is copy most of the 'format' description into format_string, since it seems wrong somehow to refer to the docs of a deprecated from from the preferred function.