8000 minor edits to locale doc (GH-98537) · python/cpython@f7d2c94 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f7d2c94

Browse files
minor edits to locale doc (GH-98537)
(cherry picked from commit c0bf760) Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
1 parent 2b79f4e commit f7d2c94

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

Doc/library/locale.rst

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ The :mod:`locale` module defines the following exception and functions:
147147
| ``CHAR_MAX`` | Nothing is specified in this locale. |
148148
+--------------+-----------------------------------------+
149149

150-
The function sets temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC``
150+
The function temporarily sets the ``LC_CTYPE`` locale to the ``LC_NUMERIC``
151151
locale or the ``LC_MONETARY`` locale if locales are different and numeric or
152152
monetary strings are non-ASCII. This temporary change affects other threads.
153153

154154
.. versionchanged:: 3.7
155-
The function now sets temporarily the ``LC_CTYPE`` locale to the
155+
The function now temporarily sets the ``LC_CTYPE`` locale to the
156156
``LC_NUMERIC`` locale in some cases.
157157

158158

@@ -227,16 +227,18 @@ The :mod:`locale` module defines the following exception and functions:
227227
Get a regular expression that can be used with the regex function to
228228
recognize a positive response to a yes/no question.
229229

230-
.. note::
231-
232-
The expression is in the syntax suitable for the :c:func:`regex` function
233-
from the C library, which might differ from the syntax used in :mod:`re`.
234-
235230
.. data:: NOEXPR
236231

237232
Get a regular expression that can be used with the regex(3) function to
238233
recognize a negative response to a yes/no question.
239234

235+
.. note::
236+
237+
The regular expressions for :const:`YESEXPR` and
238+
:const:`NOEXPR` use syntax suitable for the
239+
:c:func:`regex` function from the C library, which might
240+
differ from the syntax used in :mod:`re`.
241+
240242
.. data:: CRNCYSTR
241243

242244
Get the currency symbol, preceded by "-" if the symbol should appear before
@@ -399,7 +401,7 @@ The :mod:`locale` module defines the following exception and functions:
399401

400402
Formats a number *val* according to the current :const:`LC_NUMERIC` setting.
401403
The format follows the conventions of the ``%`` operator. For floating point
402-
values, the decimal point is modified if appropriate. If *grouping* is true,
404+
values, the decimal point is modified if appropriate. If *grouping* is ``True``,
403405
also takes the grouping into account.
404406

405407
If *monetary* is true, the conversion uses monetary thousands separator and
@@ -429,12 +431,14 @@ The :mod:`locale` module defines the following exception and functions:
429431
Formats a number *val* according to the current :const:`LC_MONETARY` settings.
430432

431433
The returned string includes the currency symbol if *symbol* is true, which is
432-
the default. If *grouping* is true (which is not the default), grouping is done
433-
with the value. If *international* is true (which is not the default), the
434+
the default. If *grouping* is ``True`` (which is not the default), grouping is done
435+
with the value. If *international* is ``True`` (which is not the default), the
434436
international currency symbol is used.
435437

436-
Note that this function will not work with the 'C' locale, so you have to set a
437-
locale via :func:`setlocale` first.
438+
.. note::
439+
440+
This function will not work with the 'C' locale, so you have to set a
441+
locale via :func:`setlocale` first.
438442

439443

440444
.. function:: str(float)
@@ -621,4 +625,3 @@ applications that link with additional C libraries which internally invoke
621625
:c:func:`gettext` or :c:func:`dcgettext`. For these applications, it may be
622626
necessary to bind the text domain, so that the libraries can properly locate
623627
their message catalogs.
624-

0 commit comments

Comments
 (0)
0