Skip to content

Commit 8bb1257

Browse files
Deploy preview for PR 1231 🛫
1 parent f4a9588 commit 8bb1257

590 files changed

Lines changed: 756 additions & 615 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-1231/_sources/library/csv.rst.txt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ The :mod:`!csv` module defines the following classes:
316316

317317
If several delimiters fit the sample equally well ---
318318
for example if both ``','`` and ``';'`` split every row consistently ---
319-
the delimiters ``','``, ``'\t'``, ``';'``, ``' '`` and ``':'``
320-
are preferred, in this order,
319+
the delimiters listed in the :attr:`~Sniffer.preferred` attribute
320+
are preferred, in that order,
321321
no matter how many times each of them occurs.
322322

323323
.. method:: has_header(sample)
@@ -339,6 +339,15 @@ The :mod:`!csv` module defines the following classes:
339339
This method is a rough heuristic and may produce both false positives and
340340
negatives.
341341

342+
The :class:`Sniffer` class has the following attribute:
343+
344+
.. attribute:: preferred
345+
346+
The list of the delimiters preferred for breaking ties,
347+
in the order of preference.
348+
It can be modified.
349+
Its initial value is ``[',', '\t', ';', ' ', ':']``.
350+
342351
An example for :class:`Sniffer` use::
343352

344353
with open('example.csv', newline='') as csvfile:
@@ -362,6 +371,8 @@ The :mod:`!csv` module defines the following constants:
362371
Instructs :class:`writer` objects to only quote those fields which contain
363372
special characters such as *delimiter*, *quotechar*, ``'\r'``, ``'\n'``
364373
or any of the characters in *lineterminator*.
374+
If *doublequote* is :const:`False` and *escapechar* is set,
375+
the *quotechar* is escaped instead of causing the field to be quoted.
365376

366377

367378
.. data:: QUOTE_NONNUMERIC
@@ -466,6 +477,10 @@ Dialects support the following attributes:
466477
On reading, the *escapechar* removes any special meaning from
467478
the following character. It defaults to :const:`None`, which disables escaping.
468479

480+
.. versionchanged:: 3.10
481+
Previously the *escapechar* itself was not escaped,
482+
which lost it on reading.
483+
469484
.. versionchanged:: 3.11
470485
An empty *escapechar* is not allowed.
471486

pr-preview/pr-1231/_sources/library/curses.rst.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ Linux and the BSD variants of Unix.
3434
Whenever the documentation mentions a *character string* it can be specified
3535
as a Unicode string or a byte string.
3636

37+
.. note::
38+
39+
Whether curses may be used from several threads
40+
depends on the underlying library and how it was built.
41+
In many implementations, including the default build of ncurses,
42+
the screen state is shared and not thread-safe;
43+
since the blocking and refresh methods
44+
(such as :meth:`~window.getch` and :meth:`~window.refresh`)
45+
release the :term:`GIL`,
46+
unsynchronized use from several threads can then crash the interpreter.
47+
Serialize the calls.
48+
3749
.. seealso::
3850

3951
Module :mod:`curses.ascii`

pr-preview/pr-1231/_sources/library/inspect.rst.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ Retrieving source code
714714
.. function:: getfile(object)
715715

716716
Return the name of the (text or binary) file in which an object was defined.
717+
An :exc:`OSError` is raised if the source code cannot be retrieved.
717718
This will fail with a :exc:`TypeError` if the object is a built-in module,
718719
class, or function.
719720

@@ -727,9 +728,10 @@ Retrieving source code
727728
.. function:: getsourcefile(object)
728729

729730
Return the name of the Python source file in which an object was defined
730-
or ``None`` if no way can be identified to get the source. This
731-
will fail with a :exc:`TypeError` if the object is a built-in module, class, or
732-
function.
731+
or ``None`` if no way can be identified to get the source. An :exc:`OSError` is
732+
raised if the source code cannot be retrieved.
733+
This will fail with a :exc:`TypeError` if the object is a built-in module,
734+
class, or function.
733735

734736

735737
.. function:: getsourcelines(object)

pr-preview/pr-1231/_sources/library/os.path.rst.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ the :mod:`glob` module.)
5959
Return a normalized absolutized version of the pathname *path*. On most
6060
platforms, this is equivalent to calling ``normpath(join(os.getcwd(), path))``.
6161

62+
On Windows the path is normalized by the operating system,
63+
therefore the result can differ from ``normpath(join(os.getcwd(), path))``.
64+
A drive-relative path is resolved against the current directory
65+
of the specified drive, and the drive letter is capitalized.
66+
Trailing dots and spaces are stripped.
67+
For example::
68+
69+
>>> os.path.abspath('c:spam')
70+
'C:\\Temp\\spam'
71+
>>> os.path.abspath('c:/temp/spam. . .')
72+
'c:\\temp\\spam'
73+
6274
.. seealso:: :func:`os.path.join` and :func:`os.path.normpath`.
6375

6476
.. versionchanged:: 3.6
@@ -427,6 +439,9 @@ the :mod:`glob` module.)
427439
links encountered in the path (if they are supported by the operating
428440
system). On Windows, this function will also resolve MS-DOS (also called 8.3)
429441
style names such as ``C:\\PROGRA~1`` to ``C:\\Program Files``.
442+
The returned path uses the case reported by the operating system,
443+
which can differ from the case of *path*,
444+
in particular the drive letter is capitalized.
430445

431446
By default, the path is evaluated up to the first component that does not
432447
exist, is a symlink loop, or whose evaluation raises :exc:`OSError`.

pr-preview/pr-1231/_sources/library/site.rst.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,19 @@ Module contents
241241
used in :mod:`sitecustomize` or :mod:`usercustomize` (see above).
242242

243243

244-
.. function:: getsitepackages()
244+
.. function:: getsitepackages(prefixes=None)
245245

246246
Return a list containing all global site-packages directories.
247247

248+
For each directory present in *prefixes* (or :data:`PREFIXES` if *prefixes*
249+
is ``None``), this function will find its site-packages subdirectory
250+
depending on the system environment, and will return a list of full paths.
251+
248252
.. versionadded:: 3.2
249253

254+
.. versionchanged:: 3.3
255+
Added the optional *prefixes* parameter.
256+
250257

251258
.. function:: getuserbase()
252259

pr-preview/pr-1231/_sources/library/stdtypes.rst.txt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,7 +2585,8 @@ expression support in the :mod:`re` module).
25852585

25862586
Return a list of the words in the string, using *sep* as the delimiter string.
25872587
If *maxsplit* is given, at most *maxsplit* splits are done, the *rightmost*
2588-
ones. If *sep* is not specified or ``None``, any whitespace string is a
2588+
ones. If *sep* is not specified or ``None``, any
2589+
:meth:`whitespace <str.isspace>` string is a
25892590
separator. Except for splitting from the right, :meth:`rsplit` behaves like
25902591
:meth:`split` which is described in detail below.
25912592

@@ -2645,7 +2646,8 @@ expression support in the :mod:`re` module).
26452646
['1', '2', '3<4']
26462647

26472648
If *sep* is not specified or is ``None``, a different splitting algorithm is
2648-
applied: runs of consecutive whitespace are regarded as a single separator,
2649+
applied: runs of consecutive :meth:`whitespace <str.isspace>` are regarded
2650+
as a single separator,
26492651
and the result will contain no empty strings at the start or end if the
26502652
string has leading or trailing whitespace. Consequently, splitting an empty
26512653
string or a string consisting of just whitespace with a ``None`` separator
@@ -3875,7 +3877,8 @@ produce new objects.
38753877
Return a copy of the sequence with specified leading bytes removed. The
38763878
*bytes* argument is a binary sequence specifying the set of byte values to
38773879
be removed. If omitted or ``None``, the *bytes* argument defaults
3878-
to removing ASCII whitespace. The *bytes* argument is not a prefix;
3880+
to removing :meth:`ASCII whitespace <bytes.isspace>`.
3881+
The *bytes* argument is not a prefix;
38793882
rather, all combinations of its values are stripped::
38803883

38813884
>>> b' spacious '.lstrip()
@@ -3919,7 +3922,8 @@ produce new objects.
39193922
Split the binary sequence into subsequences of the same type, using *sep*
39203923
as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits
39213924
are done, the *rightmost* ones. If *sep* is not specified or ``None``,
3922-
any subsequence consisting solely of ASCII whitespace is a separator.
3925+
any subsequence consisting solely of
3926+
:meth:`ASCII whitespace <bytes.isspace>` is a separator.
39233927
Except for splitting from the right, :meth:`rsplit` behaves like
39243928
:meth:`split` which is described in detail below.
39253929

@@ -3930,7 +3934,8 @@ produce new objects.
39303934
Return a copy of the sequence with specified trailing bytes removed. The
39313935
*bytes* argument is a binary sequence specifying the set of byte values to
39323936
be removed. If omitted or ``None``, the *bytes* argument defaults to
3933-
removing ASCII whitespace. The *bytes* argument is not a suffix; rather,
3937+
removing :meth:`ASCII whitespace <bytes.isspace>`.
3938+
The *bytes* argument is not a suffix; rather,
39343939
all combinations of its values are stripped::
39353940

39363941
>>> b' spacious '.rstrip()
@@ -3983,7 +3988,8 @@ produce new objects.
39833988
[b'1', b'2', b'3<4']
39843989

39853990
If *sep* is not specified or is ``None``, a different splitting algorithm
3986-
is applied: runs of consecutive ASCII whitespace are regarded as a single
3991+
is applied: runs of consecutive :meth:`ASCII whitespace <bytes.isspace>`
3992+
are regarded as a single
39873993
separator, and the result will contain no empty strings at the start or
39883994
end if the sequence has leading or trailing whitespace. Consequently,
39893995
splitting an empty sequence or a sequence consisting solely of ASCII
@@ -4006,7 +4012,8 @@ produce new objects.
40064012
Return a copy of the sequence with specified leading and trailing bytes
40074013
removed. The *bytes* argument is a binary sequence specifying the set of
40084014
byte values to be removed. If omitted or ``None``, the *bytes*
4009-
argument defaults to removing ASCII whitespace. The *bytes* argument is
4015+
argument defaults to removing :meth:`ASCII whitespace <bytes.isspace>`.
4016+
The *bytes* argument is
40104017
not a prefix or suffix; rather, all combinations of its values are
40114018
stripped::
40124019

pr-preview/pr-1231/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-
最後更新於 8月 13, 2026 (00:27 UTC)。
359+
最後更新於 8月 14, 2026 (00:26 UTC)。
360360

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

pr-preview/pr-1231/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-
最後更新於 8月 13, 2026 (00:27 UTC)。
396+
最後更新於 8月 14, 2026 (00:26 UTC)。
397397

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

pr-preview/pr-1231/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-
最後更新於 8月 13, 2026 (00:27 UTC)。
368+
最後更新於 8月 14, 2026 (00:26 UTC)。
369369

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

pr-preview/pr-1231/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-
最後更新於 8月 13, 2026 (00:27 UTC)。
580+
最後更新於 8月 14, 2026 (00:26 UTC)。
581581

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

0 commit comments

Comments
 (0)