diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2022-10-03 13:11:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-03 13:11:06 (GMT) |
commit | bead571e6a2752d111f4995bcd4a0c2c3b19c6b6 (patch) | |
tree | f3bb316fda77dab7961eeba9e4379740d4d775e5 | |
parent | a1711ef030d0b637da75ff5a870ac1a3fd959c04 (diff) | |
download | cpython-bead571e6a2752d111f4995bcd4a0c2c3b19c6b6.zip cpython-bead571e6a2752d111f4995bcd4a0c2c3b19c6b6.tar.gz cpython-bead571e6a2752d111f4995bcd4a0c2c3b19c6b6.tar.bz2 |
[3.10] gh-96845: Fix docs around importlib.abc.Traversable (GH-97515)
* [3.10] gh-96845: Correct reference to Traversable* classes.
* [3.10] gh-96845: Add a note about the pending move of resources.abcs.
-rw-r--r-- | Doc/library/importlib.rst | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 3981cc6..1addba3 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -854,6 +854,8 @@ ABC hierarchy:: Read contents of self as text. + Note: In Python 3.11 and later, this class is found in ``importlib.resources.abc``. + .. class:: TraversableResources @@ -868,6 +870,8 @@ ABC hierarchy:: .. versionadded:: 3.9 + Note: In Python 3.11 and later, this class is found in ``importlib.resources.abc``. + :mod:`importlib.resources` -- Resources --------------------------------------- @@ -930,7 +934,7 @@ The following functions are available. .. function:: files(package) - Returns an :class:`importlib.resources.abc.Traversable` object + Returns an :class:`importlib.abc.Traversable` object representing the resource container for the package (think directory) and its resources (think files). A Traversable may contain other containers (think subdirectories). @@ -942,7 +946,7 @@ The following functions are available. .. function:: as_file(traversable) - Given a :class:`importlib.resources.abc.Traversable` object representing + Given a :class:`importlib.abc.Traversable` object representing a file, typically from :func:`importlib.resources.files`, return a context manager for use in a :keyword:`with` statement. The context manager provides a :class:`pathlib.Path` object. |