Skip to content

Commit

Permalink
Deploying to gh-pages from @ c5befbd 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwang44 committed Jul 3, 2024
1 parent fbb06a7 commit 8881a92
Show file tree
Hide file tree
Showing 532 changed files with 4,617 additions and 4,565 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 0f6df315d03b26c465022e5afc65623d
config: dc633053b47cf567650a3dcb5abc6525
tags: 645f666f9bcd5a90fca523b33c5a78b7
195 changes: 100 additions & 95 deletions _sources/library/pathlib.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ inherit from pure paths but also provide I/O operations.
.. image:: pathlib-inheritance.png
:align: center
:class: invert-in-dark-mode
:alt: Inheritance diagram showing the classes available in pathlib. The
most basic class is PurePath, which has three direct subclasses:
PurePosixPath, PureWindowsPath, and Path. Further to these four
classes, there are two classes that use multiple inheritance:
PosixPath subclasses PurePosixPath and Path, and WindowsPath
subclasses PureWindowsPath and Path.

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


Expanding and resolving paths
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. classmethod:: Path.home()

Return a new path object representing the user's home directory (as
returned by :func:`os.path.expanduser` with ``~`` construct). If the home
directory can't be resolved, :exc:`RuntimeError` is raised.

::

>>> Path.home()
PosixPath('/home/antoine')

.. versionadded:: 3.5


.. method:: Path.expanduser()

Return a new path with expanded ``~`` and ``~user`` constructs,
as returned by :meth:`os.path.expanduser`. If a home directory can't be
resolved, :exc:`RuntimeError` is raised.

::

>>> p = PosixPath('~/films/Monty Python')
>>> p.expanduser()
PosixPath('/home/eric/films/Monty Python')

.. versionadded:: 3.5


.. classmethod:: Path.cwd()

Return a new path object representing the current directory (as returned
by :func:`os.getcwd`)::

>>> Path.cwd()
PosixPath('/home/antoine/pathlib')


.. method:: Path.absolute()

Make the path absolute, without normalization or resolving symlinks.
Returns a new path object::

>>> p = Path('tests')
>>> p
PosixPath('tests')
>>> p.absolute()
PosixPath('/home/antoine/pathlib/tests')


.. method:: Path.resolve(strict=False)

Make the path absolute, resolving any symlinks. A new path object is
returned::

>>> p = Path()
>>> p
PosixPath('.')
>>> p.resolve()
PosixPath('/home/antoine/pathlib')

"``..``" components are also eliminated (this is the only method to do so)::

>>> p = Path('docs/../setup.py')
>>> p.resolve()
PosixPath('/home/antoine/pathlib/setup.py')

If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError`
is raised. If *strict* is ``False``, the path is resolved as far as possible
and any remainder is appended without checking whether it exists. If an
infinite loop is encountered along the resolution path, :exc:`RuntimeError`
is raised.

.. versionchanged:: 3.6
The *strict* parameter was added (pre-3.6 behavior is strict).


.. method:: Path.readlink()

Return the path to which the symbolic link points (as returned by
:func:`os.readlink`)::

>>> p = Path('mylink')
>>> p.symlink_to('setup.py')
>>> p.readlink()
PosixPath('setup.py')

.. versionadded:: 3.9


Querying file type and status
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -1380,7 +1479,7 @@ Renaming and deleting
Remove this directory. The directory must be empty.


Ownership and permissions
Permissions and ownership
^^^^^^^^^^^^^^^^^^^^^^^^^

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


Other methods
^^^^^^^^^^^^^

.. classmethod:: Path.cwd()

Return a new path object representing the current directory (as returned
by :func:`os.getcwd`)::

>>> Path.cwd()
PosixPath('/home/antoine/pathlib')


.. classmethod:: Path.home()

Return a new path object representing the user's home directory (as
returned by :func:`os.path.expanduser` with ``~`` construct). If the home
directory can't be resolved, :exc:`RuntimeError` is raised.

::

>>> Path.home()
PosixPath('/home/antoine')

.. versionadded:: 3.5


.. method:: Path.expanduser()

Return a new path with expanded ``~`` and ``~user`` constructs,
as returned by :meth:`os.path.expanduser`. If a home directory can't be
resolved, :exc:`RuntimeError` is raised.

::

>>> p = PosixPath('~/films/Monty Python')
>>> p.expanduser()
PosixPath('/home/eric/films/Monty Python')

.. versionadded:: 3.5


.. method:: Path.readlink()

Return the path to which the symbolic link points (as returned by
:func:`os.readlink`)::

>>> p = Path('mylink')
>>> p.symlink_to('setup.py')
>>> p.readlink()
PosixPath('setup.py')

.. versionadded:: 3.9


.. method:: Path.absolute()

Make the path absolute, without normalization or resolving symlinks.
Returns a new path object::

>>> p = Path('tests')
>>> p
PosixPath('tests')
>>> p.absolute()
PosixPath('/home/antoine/pathlib/tests')


.. method:: Path.resolve(strict=False)

Make the path absolute, resolving any symlinks. A new path object is
returned::

>>> p = Path()
>>> p
PosixPath('.')
>>> p.resolve()
PosixPath('/home/antoine/pathlib')

"``..``" components are also eliminated (this is the only method to do so)::

>>> p = Path('docs/../setup.py')
>>> p.resolve()
PosixPath('/home/antoine/pathlib/setup.py')

If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError`
is raised. If *strict* is ``False``, the path is resolved as far as possible
and any remainder is appended without checking whether it exists. If an
infinite loop is encountered along the resolution path, :exc:`RuntimeError`
is raised.

.. versionchanged:: 3.6
The *strict* parameter was added (pre-3.6 behavior is strict).



Correspondence to tools in the :mod:`os` module
-----------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion _sources/library/stdtypes.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4556,7 +4556,7 @@ can be used interchangeably to index the same dictionary entry.

Return a shallow copy of the dictionary.

.. classmethod:: fromkeys(iterable, value=None)
.. classmethod:: fromkeys(iterable, value=None, /)

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

Expand Down
10 changes: 6 additions & 4 deletions _sources/reference/expressions.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,12 @@ A comprehension in an :keyword:`!async def` function may consist of either a
:keyword:`!for` or :keyword:`!async for` clause following the leading
expression, may contain additional :keyword:`!for` or :keyword:`!async for`
clauses, and may also use :keyword:`await` expressions.
If a comprehension contains either :keyword:`!async for` clauses or
:keyword:`!await` expressions or other asynchronous comprehensions it is called
an :dfn:`asynchronous comprehension`. An asynchronous comprehension may
suspend the execution of the coroutine function in which it appears.

If a comprehension contains :keyword:`!async for` clauses, or if it contains
:keyword:`!await` expressions or other asynchronous comprehensions anywhere except
the iterable expression in the leftmost :keyword:`!for` clause, it is called an
:dfn:`asynchronous comprehension`. An asynchronous comprehension may suspend the
execution of the coroutine function in which it appears.
See also :pep:`530`.

.. versionadded:: 3.6
Expand Down
2 changes: 2 additions & 0 deletions _sources/using/cmdline.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ Miscellaneous options
-Wdefault # Warn once per call location
-Werror # Convert to exceptions
-Walways # Warn every time
-Wall # Same as -Walways
-Wmodule # Warn once per calling module
-Wonce # Warn once per Python process
-Wignore # Never warn
Expand Down Expand Up @@ -842,6 +843,7 @@ conflict.
PYTHONWARNINGS=default # Warn once per call location
PYTHONWARNINGS=error # Convert to exceptions
PYTHONWARNINGS=always # Warn every time
PYTHONWARNINGS=all # Same as PYTHONWARNINGS=always
PYTHONWARNINGS=module # Warn once per calling module
PYTHONWARNINGS=once # Warn once per Python process
PYTHONWARNINGS=ignore # Never warn
Expand Down
2 changes: 1 addition & 1 deletion about.html
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 Jun 29, 2024 (06:51 UTC)。
最後更新於 Jul 03, 2024 (03:49 UTC)。

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

Expand Down
4 changes: 2 additions & 2 deletions bugs.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ <h2>說明文件的錯誤<a class="headerlink" href="#documentation-bugs" title=
</section>
<section id="getting-started-contributing-to-python-yourself">
<span id="contributing-to-python"></span><h2>開始讓自己貢獻 Python<a class="headerlink" href="#getting-started-contributing-to-python-yourself" title="連結到這個標頭"></a></h2>
<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>
<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>
</section>
</section>

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

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/abstract.html
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 Jun 29, 2024 (06:51 UTC)。
最後更新於 Jul 03, 2024 (03:49 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/allocation.html
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 Jun 29, 2024 (06:51 UTC)。
最後更新於 Jul 03, 2024 (03:49 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/apiabiversion.html
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 Jun 29, 2024 (06:51 UTC)。
最後更新於 Jul 03, 2024 (03:49 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/arg.html
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 Jun 29, 2024 (06:51 UTC)。
最後更新於 Jul 03, 2024 (03:49 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/bool.html
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 Jun 29, 2024 (06:51 UTC)。
最後更新於 Jul 03, 2024 (03:49 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/buffer.html
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 Jun 29, 2024 (06:51 UTC)。
最後更新於 Jul 03, 2024 (03:49 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/bytearray.html
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 Jun 29, 2024 (06:51 UTC)。
最後更新於 Jul 03, 2024 (03:49 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/bytes.html
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 Jun 29, 2024 (06:51 UTC)。
最後更新於 Jul 03, 2024 (03:49 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/call.html
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 Jun 29, 2024 (06:51 UTC)。
最後更新於 Jul 03, 2024 (03:49 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/capsule.html
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 Jun 29, 2024 (06:51 UTC)。
最後更新於 Jul 03, 2024 (03:49 UTC)。

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

Expand Down
2 changes: 1 addition & 1 deletion c-api/cell.html
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ <h3>瀏覽</h3>
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最後更新於 Jun 29, 2024 (06:51 UTC)。
最後更新於 Jul 03, 2024 (03:49 UTC)。

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

Expand Down
Loading

0 comments on commit 8881a92

Please sign in to comment.