From 1f47e59f68746c0fdea1043c1398432a3ae62551 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 10 Jun 2022 16:11:58 -0700 Subject: [PATCH] gh-89896: `importlib.abc.Traversable.name` is an attribute, not a method Closes #89896 This also addresses #93610 in that it fixes the link to `importlib.abc.Traversable` too, for Python 3.10 and earlier. --- Doc/library/importlib.rst | 8 ++++---- .../2022-06-10-15-45-41.gh-issue-93610.wSHRJg.rst | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Documentation/2022-06-10-15-45-41.gh-issue-93610.wSHRJg.rst diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 85c23472e27560..c13d80e48232ec 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -814,9 +814,9 @@ ABC hierarchy:: .. versionadded:: 3.9 - .. abstractmethod:: name() + .. attribute:: name - The base name of this object without any parent references. + Abstract. The base name of this object without any parent references. .. abstractmethod:: iterdir() @@ -930,7 +930,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 +942,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. diff --git a/Misc/NEWS.d/next/Documentation/2022-06-10-15-45-41.gh-issue-93610.wSHRJg.rst b/Misc/NEWS.d/next/Documentation/2022-06-10-15-45-41.gh-issue-93610.wSHRJg.rst new file mode 100644 index 00000000000000..de68fbfd5517f9 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2022-06-10-15-45-41.gh-issue-93610.wSHRJg.rst @@ -0,0 +1 @@ +``importlib.abc.Traversable.name`` is an attribute, not a method.