Skip to content

Commit

Permalink
pythongh-89896: importlib.abc.Traversable.name is an attribute, not…
Browse files Browse the repository at this point in the history
… a method

Closes python#89896

This also addresses python#93610 in that it fixes the link to
`importlib.abc.Traversable` too, for Python 3.10 and earlier.
  • Loading branch information
warsaw committed Jun 11, 2022
1 parent 58277de commit 1f47e59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Doc/library/importlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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).
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``importlib.abc.Traversable.name`` is an attribute, not a method.

0 comments on commit 1f47e59

Please sign in to comment.