Skip to content

Commit 8881a92

Browse files
committed
Deploying to gh-pages from @ c5befbd 🚀
1 parent fbb06a7 commit 8881a92

File tree

532 files changed

+4617
-4565
lines changed

Some content is hidden

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

532 files changed

+4617
-4565
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 0f6df315d03b26c465022e5afc65623d
3+
config: dc633053b47cf567650a3dcb5abc6525
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_sources/library/pathlib.rst.txt

Lines changed: 100 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ inherit from pure paths but also provide I/O operations.
2121
.. image:: pathlib-inheritance.png
2222
:align: center
2323
:class: invert-in-dark-mode
24+
:alt: Inheritance diagram showing the classes available in pathlib. The
25+
most basic class is PurePath, which has three direct subclasses:
26+
PurePosixPath, PureWindowsPath, and Path. Further to these four
27+
classes, there are two classes that use multiple inheritance:
28+
PosixPath subclasses PurePosixPath and Path, and WindowsPath
29+
subclasses PureWindowsPath and Path.
2430

2531
If you've never used this module before or just aren't sure which class is
2632
right for your task, :class:`Path` is most likely what you need. It instantiates
@@ -793,6 +799,99 @@ Some concrete path methods can raise an :exc:`OSError` if a system call fails
793799
(for example because the path doesn't exist).
794800

795801

802+
Expanding and resolving paths
803+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
804+
805+
.. classmethod:: Path.home()
806+
807+
Return a new path object representing the user's home directory (as
808+
returned by :func:`os.path.expanduser` with ``~`` construct). If the home
809+
directory can't be resolved, :exc:`RuntimeError` is raised.
810+
811+
::
812+
813+
>>> Path.home()
814+
PosixPath('/home/antoine')
815+
816+
.. versionadded:: 3.5
817+
818+
819+
.. method:: Path.expanduser()
820+
821+
Return a new path with expanded ``~`` and ``~user`` constructs,
822+
as returned by :meth:`os.path.expanduser`. If a home directory can't be
823+
resolved, :exc:`RuntimeError` is raised.
824+
825+
::
826+
827+
>>> p = PosixPath('~/films/Monty Python')
828+
>>> p.expanduser()
829+
PosixPath('/home/eric/films/Monty Python')
830+
831+
.. versionadded:: 3.5
832+
833+
834+
.. classmethod:: Path.cwd()
835+
836+
Return a new path object representing the current directory (as returned
837+
by :func:`os.getcwd`)::
838+
839+
>>> Path.cwd()
840+
PosixPath('/home/antoine/pathlib')
841+
842+
843+
.. method:: Path.absolute()
844+
845+
Make the path absolute, without normalization or resolving symlinks.
846+
Returns a new path object::
847+
848+
>>> p = Path('tests')
849+
>>> p
850+
PosixPath('tests')
851+
>>> p.absolute()
852+
PosixPath('/home/antoine/pathlib/tests')
853+
854+
855+
.. method:: Path.resolve(strict=False)
856+
857+
Make the path absolute, resolving any symlinks. A new path object is
858+
returned::
859+
860+
>>> p = Path()
861+
>>> p
862+
PosixPath('.')
863+
>>> p.resolve()
864+
PosixPath('/home/antoine/pathlib')
865+
866+
"``..``" components are also eliminated (this is the only method to do so)::
867+
868+
>>> p = Path('docs/../setup.py')
869+
>>> p.resolve()
870+
PosixPath('/home/antoine/pathlib/setup.py')
871+
872+
If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError`
873+
is raised. If *strict* is ``False``, the path is resolved as far as possible
874+
and any remainder is appended without checking whether it exists. If an
875+
infinite loop is encountered along the resolution path, :exc:`RuntimeError`
876+
is raised.
877+
878+
.. versionchanged:: 3.6
879+
The *strict* parameter was added (pre-3.6 behavior is strict).
880+
881+
882+
.. method:: Path.readlink()
883+
884+
Return the path to which the symbolic link points (as returned by
885+
:func:`os.readlink`)::
886+
887+
>>> p = Path('mylink')
888+
>>> p.symlink_to('setup.py')
889+
>>> p.readlink()
890+
PosixPath('setup.py')
891+
892+
.. versionadded:: 3.9
893+
894+
796895
Querying file type and status
797896
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
798897

@@ -1380,7 +1479,7 @@ Renaming and deleting
13801479
Remove this directory. The directory must be empty.
13811480

13821481

1383-
Ownership and permissions
1482+
Permissions and ownership
13841483
^^^^^^^^^^^^^^^^^^^^^^^^^
13851484

13861485
.. method:: Path.owner()
@@ -1422,100 +1521,6 @@ Ownership and permissions
14221521
symbolic link's mode is changed rather than its target's.
14231522

14241523

1425-
Other methods
1426-
^^^^^^^^^^^^^
1427-
1428-
.. classmethod:: Path.cwd()
1429-
1430-
Return a new path object representing the current directory (as returned
1431-
by :func:`os.getcwd`)::
1432-
1433-
>>> Path.cwd()
1434-
PosixPath('/home/antoine/pathlib')
1435-
1436-
1437-
.. classmethod:: Path.home()
1438-
1439-
Return a new path object representing the user's home directory (as
1440-
returned by :func:`os.path.expanduser` with ``~`` construct). If the home
1441-
directory can't be resolved, :exc:`RuntimeError` is raised.
1442-
1443-
::
1444-
1445-
>>> Path.home()
1446-
PosixPath('/home/antoine')
1447-
1448-
.. versionadded:: 3.5
1449-
1450-
1451-
.. method:: Path.expanduser()
1452-
1453-
Return a new path with expanded ``~`` and ``~user`` constructs,
1454-
as returned by :meth:`os.path.expanduser`. If a home directory can't be
1455-
resolved, :exc:`RuntimeError` is raised.
1456-
1457-
::
1458-
1459-
>>> p = PosixPath('~/films/Monty Python')
1460-
>>> p.expanduser()
1461-
PosixPath('/home/eric/films/Monty Python')
1462-
1463-
.. versionadded:: 3.5
1464-
1465-
1466-
.. method:: Path.readlink()
1467-
1468-
Return the path to which the symbolic link points (as returned by
1469-
:func:`os.readlink`)::
1470-
1471-
>>> p = Path('mylink')
1472-
>>> p.symlink_to('setup.py')
1473-
>>> p.readlink()
1474-
PosixPath('setup.py')
1475-
1476-
.. versionadded:: 3.9
1477-
1478-
1479-
.. method:: Path.absolute()
1480-
1481-
Make the path absolute, without normalization or resolving symlinks.
1482-
Returns a new path object::
1483-
1484-
>>> p = Path('tests')
1485-
>>> p
1486-
PosixPath('tests')
1487-
>>> p.absolute()
1488-
PosixPath('/home/antoine/pathlib/tests')
1489-
1490-
1491-
.. method:: Path.resolve(strict=False)
1492-
1493-
Make the path absolute, resolving any symlinks. A new path object is
1494-
returned::
1495-
1496-
>>> p = Path()
1497-
>>> p
1498-
PosixPath('.')
1499-
>>> p.resolve()
1500-
PosixPath('/home/antoine/pathlib')
1501-
1502-
"``..``" components are also eliminated (this is the only method to do so)::
1503-
1504-
>>> p = Path('docs/../setup.py')
1505-
>>> p.resolve()
1506-
PosixPath('/home/antoine/pathlib/setup.py')
1507-
1508-
If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError`
1509-
is raised. If *strict* is ``False``, the path is resolved as far as possible
1510-
and any remainder is appended without checking whether it exists. If an
1511-
infinite loop is encountered along the resolution path, :exc:`RuntimeError`
1512-
is raised.
1513-
1514-
.. versionchanged:: 3.6
1515-
The *strict* parameter was added (pre-3.6 behavior is strict).
1516-
1517-
1518-
15191524
Correspondence to tools in the :mod:`os` module
15201525
-----------------------------------------------
15211526

_sources/library/stdtypes.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4556,7 +4556,7 @@ can be used interchangeably to index the same dictionary entry.
45564556

45574557
Return a shallow copy of the dictionary.
45584558

4559-
.. classmethod:: fromkeys(iterable, value=None)
4559+
.. classmethod:: fromkeys(iterable, value=None, /)
45604560

45614561
Create a new dictionary with keys from *iterable* and values set to *value*.
45624562

_sources/reference/expressions.rst.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,12 @@ A comprehension in an :keyword:`!async def` function may consist of either a
218218
:keyword:`!for` or :keyword:`!async for` clause following the leading
219219
expression, may contain additional :keyword:`!for` or :keyword:`!async for`
220220
clauses, and may also use :keyword:`await` expressions.
221-
If a comprehension contains either :keyword:`!async for` clauses or
222-
:keyword:`!await` expressions or other asynchronous comprehensions it is called
223-
an :dfn:`asynchronous comprehension`. An asynchronous comprehension may
224-
suspend the execution of the coroutine function in which it appears.
221+
222+
If a comprehension contains :keyword:`!async for` clauses, or if it contains
223+
:keyword:`!await` expressions or other asynchronous comprehensions anywhere except
224+
the iterable expression in the leftmost :keyword:`!for` clause, it is called an
225+
:dfn:`asynchronous comprehension`. An asynchronous comprehension may suspend the
226+
execution of the coroutine function in which it appears.
225227
See also :pep:`530`.
226228

227229
.. versionadded:: 3.6

_sources/using/cmdline.rst.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ Miscellaneous options
440440
-Wdefault # Warn once per call location
441441
-Werror # Convert to exceptions
442442
-Walways # Warn every time
443+
-Wall # Same as -Walways
443444
-Wmodule # Warn once per calling module
444445
-Wonce # Warn once per Python process
445446
-Wignore # Never warn
@@ -842,6 +843,7 @@ conflict.
842843
PYTHONWARNINGS=default # Warn once per call location
843844
PYTHONWARNINGS=error # Convert to exceptions
844845
PYTHONWARNINGS=always # Warn every time
846+
PYTHONWARNINGS=all # Same as PYTHONWARNINGS=always
845847
PYTHONWARNINGS=module # Warn once per calling module
846848
PYTHONWARNINGS=once # Warn once per Python process
847849
PYTHONWARNINGS=ignore # Never warn

about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ <h3>瀏覽</h3>
319319
<a href="https://www.python.org/psf/donations/">Please donate.</a>
320320
<br />
321321
<br />
322-
最後更新於 Jun 29, 2024 (06:51 UTC)。
322+
最後更新於 Jul 03, 2024 (03:49 UTC)。
323323

324324
<a href="/bugs.html">Found a bug</a>?
325325

bugs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ <h2>說明文件的錯誤<a class="headerlink" href="#documentation-bugs" title=
230230
</section>
231231
<section id="getting-started-contributing-to-python-yourself">
232232
<span id="contributing-to-python"></span><h2>開始讓自己貢獻 Python<a class="headerlink" href="#getting-started-contributing-to-python-yourself" title="連結到這個標頭"></a></h2>
233-
<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>
233+
<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>
234234
</section>
235235
</section>
236236

@@ -358,7 +358,7 @@ <h3>瀏覽</h3>
358358
<a href="https://www.python.org/psf/donations/">Please donate.</a>
359359
<br />
360360
<br />
361-
最後更新於 Jun 29, 2024 (06:51 UTC)。
361+
最後更新於 Jul 03, 2024 (03:49 UTC)。
362362

363363
<a href="/bugs.html">Found a bug</a>?
364364

c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ <h3>瀏覽</h3>
329329
<a href="https://www.python.org/psf/donations/">Please donate.</a>
330330
<br />
331331
<br />
332-
最後更新於 Jun 29, 2024 (06:51 UTC)。
332+
最後更新於 Jul 03, 2024 (03:49 UTC)。
333333

334334
<a href="/bugs.html">Found a bug</a>?
335335

c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ <h3>瀏覽</h3>
343343
<a href="https://www.python.org/psf/donations/">Please donate.</a>
344344
<br />
345345
<br />
346-
最後更新於 Jun 29, 2024 (06:51 UTC)。
346+
最後更新於 Jul 03, 2024 (03:49 UTC)。
347347

348348
<a href="/bugs.html">Found a bug</a>?
349349

c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ <h3>瀏覽</h3>
375375
<a href="https://www.python.org/psf/donations/">Please donate.</a>
376376
<br />
377377
<br />
378-
最後更新於 Jun 29, 2024 (06:51 UTC)。
378+
最後更新於 Jul 03, 2024 (03:49 UTC)。
379379

380380
<a href="/bugs.html">Found a bug</a>?
381381

0 commit comments

Comments
 (0)