Skip to content

Commit 4b385cd

Browse files
Deploy preview for PR 1226 🛫
1 parent 21cb30a commit 4b385cd

583 files changed

Lines changed: 627 additions & 596 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pr-preview/pr-1226/_sources/library/string.rst.txt

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,9 @@ of a number respectively. It can be one of the following:
472472
| | this option is not supported. |
473473
+---------+----------------------------------------------------------+
474474

475-
For a locale aware separator, use the ``'n'`` presentation type instead.
475+
For a locale-aware separator, use the ``'n'``
476+
:ref:`float presentation type <n-format-float>` or
477+
:ref:`integer presentation type <n-format-integer>` instead.
476478

477479
.. versionchanged:: 3.1
478480
Added the ``','`` option (see also :pep:`378`).
@@ -518,9 +520,14 @@ The available integer presentation types are:
518520
| | In case ``'#'`` is specified, the prefix ``'0x'`` will |
519521
| | be upper-cased to ``'0X'`` as well. |
520522
+---------+----------------------------------------------------------+
521-
| ``'n'`` | Number. This is the same as ``'d'``, except that it uses |
523+
| ``'n'`` | .. _n-format-integer: |
524+
| | |
525+
| | Number. This is the same as ``'d'``, except that it uses |
522526
| | the current locale setting to insert the appropriate |
523-
| | digit group separators. |
527+
| | digit group separators. Note that the default locale is |
528+
| | not the system locale. Depending on your use case, you |
529+
| | may wish to set :const:`~locale.LC_NUMERIC` with |
530+
| | :func:`locale.setlocale` before using ``'n'``. |
524531
+---------+----------------------------------------------------------+
525532
| None | The same as ``'d'``. |
526533
+---------+----------------------------------------------------------+
@@ -603,10 +610,15 @@ The available presentation types for :class:`float` and
603610
| | ``'E'`` if the number gets too large. The |
604611
| | representations of infinity and NaN are uppercased, too. |
605612
+---------+----------------------------------------------------------+
606-
| ``'n'`` | Number. This is the same as ``'g'``, except that it uses |
613+
| ``'n'`` | .. _n-format-float: |
614+
| | |
615+
| | Number. This is the same as ``'g'``, except that it uses |
607616
| | the current locale setting to insert the appropriate |
608-
| | digit group separators |
609-
| | for the integral part of a number. |
617+
| | digit group separators for the integral part of a |
618+
| | number. Note that the default locale is not the system |
619+
| | locale. Depending on your use case, you may wish to set |
620+
| | :const:`~locale.LC_NUMERIC` with |
621+
| | :func:`locale.setlocale` before using ``'n'``. |
610622
+---------+----------------------------------------------------------+
611623
| ``'%'`` | Percentage. Multiplies the number by 100 and displays |
612624
| | in fixed (``'f'``) format, followed by a percent sign. |

pr-preview/pr-1226/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ <h3>導航</h3>
356356
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
357357
<br>
358358
<br>
359-
最後更新於 5月 20, 2026 (00:45 UTC)。
359+
最後更新於 5月 21, 2026 (00:45 UTC)。
360360

361361
<a href="/bugs.html">發現 bug</a>
362362

pr-preview/pr-1226/bugs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ <h2>說明文件的錯誤<a class="headerlink" href="#documentation-bugs" title=
250250
</section>
251251
<section id="getting-started-contributing-to-python-yourself">
252252
<span id="contributing-to-python"></span><h2>開始讓自己貢獻 Python<a class="headerlink" href="#getting-started-contributing-to-python-yourself" title="連結到這個標頭"></a></h2>
253-
<p>除了只是回報你所發現的錯誤之外,同樣也歡迎你提交修正它們的修補程式 (patch)。你可以在 <a class="reference external" href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果你有任何問題,<a class="reference external" href="https://devguide.python.org/">核心導師郵寄清單</a>是一個友善的地方,你可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
253+
<p>除了只是回報你所發現的錯誤之外,同樣也歡迎你提交修正它們的修補程式 (patch)。你可以在 <a class="reference external" href="https://devguide.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果你有任何問題,<a class="reference external" href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">核心導師郵寄清單</a>是一個友善的地方,你可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
254254
</section>
255255
</section>
256256

@@ -393,7 +393,7 @@ <h3>導航</h3>
393393
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
394394
<br>
395395
<br>
396-
最後更新於 5月 20, 2026 (00:45 UTC)。
396+
最後更新於 5月 21, 2026 (00:45 UTC)。
397397

398398
<a href="/bugs.html">發現 bug</a>
399399

pr-preview/pr-1226/c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ <h3>導航</h3>
365365
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
366366
<br>
367367
<br>
368-
最後更新於 5月 20, 2026 (00:45 UTC)。
368+
最後更新於 5月 21, 2026 (00:45 UTC)。
369369

370370
<a href="/bugs.html">發現 bug</a>
371371

pr-preview/pr-1226/c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ <h3>導航</h3>
577577
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
578578
<br>
579579
<br>
580-
最後更新於 5月 20, 2026 (00:45 UTC)。
580+
最後更新於 5月 21, 2026 (00:45 UTC)。
581581

582582
<a href="/bugs.html">發現 bug</a>
583583

pr-preview/pr-1226/c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ <h3>導航</h3>
514514
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
515515
<br>
516516
<br>
517-
最後更新於 5月 20, 2026 (00:45 UTC)。
517+
最後更新於 5月 21, 2026 (00:45 UTC)。
518518

519519
<a href="/bugs.html">發現 bug</a>
520520

pr-preview/pr-1226/c-api/arg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ <h3>導航</h3>
996996
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
997997
<br>
998998
<br>
999-
最後更新於 5月 20, 2026 (00:45 UTC)。
999+
最後更新於 5月 21, 2026 (00:45 UTC)。
10001000

10011001
<a href="/bugs.html">發現 bug</a>
10021002

pr-preview/pr-1226/c-api/bool.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h3>導航</h3>
376376
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
377377
<br>
378378
<br>
379-
最後更新於 5月 20, 2026 (00:45 UTC)。
379+
最後更新於 5月 21, 2026 (00:45 UTC)。
380380

381381
<a href="/bugs.html">發現 bug</a>
382382

pr-preview/pr-1226/c-api/buffer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ <h3>導航</h3>
10641064
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
10651065
<br>
10661066
<br>
1067-
最後更新於 5月 20, 2026 (00:45 UTC)。
1067+
最後更新於 5月 21, 2026 (00:45 UTC)。
10681068

10691069
<a href="/bugs.html">發現 bug</a>
10701070

pr-preview/pr-1226/c-api/bytearray.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ <h3>導航</h3>
457457
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
458458
<br>
459459
<br>
460-
最後更新於 5月 20, 2026 (00:45 UTC)。
460+
最後更新於 5月 21, 2026 (00:45 UTC)。
461461

462462
<a href="/bugs.html">發現 bug</a>
463463

0 commit comments

Comments
 (0)