Skip to content

Commit c0bf760

Browse files
authored
minor edits to locale doc (#98537)
1 parent 2844aa6 commit c0bf760

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

Doc/library/locale.rst

+16-13
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
@@ -417,12 +419,14 @@ The :mod:`locale` module defines the following exception and functions:
417419
Formats a number *val* according to the current :const:`LC_MONETARY` settings.
418420

419421
The returned string includes the currency symbol if *symbol* is true, which is
420-
the default. If *grouping* is true (which is not the default), grouping is done
421-
with the value. If *international* is true (which is not the default), the
422+
the default. If *grouping* is ``True`` (which is not the default), grouping is done
423+
with the value. If *international* is ``True`` (which is not the default), the
422424
international currency symbol is used.
423425

424-
Note that this function will not work with the 'C' locale, so you have to set a
425-
locale via :func:`setlocale` first.
426+
.. note::
427+
428+
This function will not work with the 'C' locale, so you have to set a
429+
locale via :func:`setlocale` first.
426430

427431

428432
.. function:: str(float)
@@ -609,4 +613,3 @@ applications that link with additional C libraries which internally invoke
609613
:c:func:`gettext` or :c:func:`dcgettext`. For these applications, it may be
610614
necessary to bind the text domain, so that the libraries can properly locate
611615
their message catalogs.
612-

0 commit comments

Comments
 (0)