8000 gh-110631: Fix some incorrect indents in the documentation by koyuki7w · Pull Request #129312 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-110631: Fix some incorrect indents in the documentation #129312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update library/importlib.resources.abc.rst
  • Loading branch information
koyuki7w committed May 21, 2025
commit b8f964360ac272c19ebab7ba0965a5f165580f14
48 changes: 24 additions & 24 deletions Doc/library/importlib.resources.abc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,44 +49,44 @@
.. method:: open_resource(resource)
:abstractmethod:

Returns an opened, :term:`file-like object` for binary reading
of the *resource*.
Returns an opened, :term:`file-like object` for binary reading
of the *resource*.

If the resource cannot be found, :exc:`FileNotFoundError` is
raised.
If the resource cannot be found, :exc:`FileNotFoundError` is
raised.

.. method:: resource_path(resource)
:abstractmethod:

Returns the file system path to the *resource*.
Returns the file system path to the *resource*.

If the resource does not concretely exist on the file system,
raise :exc:`FileNotFoundError`.
If the resource does not concretely exist on the file system,
raise :exc:`FileNotFoundError`.

.. method:: is_resource(name)
:abstractmethod:

Returns ``True`` if the named *name* is considered a resource.
:exc:`FileNotFoundError` is raised if *name* does not exist.
Returns ``True`` if the named *name* is considered a resource.
:exc:`FileNotFoundError` is raised if *name* does not exist.

.. method:: contents()
:abstractmethod:

Returns an :term:`iterable` of strings over the contents of
the package. Do note that it is not required that all names
returned by the iterator be actual resources, e.g. it is
acceptable to return names for which :meth:`is_resource` would
be false.

Allowing non-resource names to be returned is to allow for
situations where how a package and its resources are stored
are known a priori and the non-resource names would be useful.
For instance, returning subdirectory names is allowed so that
when it is known that the package and resources are stored on
the file system then those subdirectory names can be used
directly.

The abstract method returns an iterable of no items.
Returns an :term:`iterable` of strings over the contents of
the package. Do note that it is not required that all names
returned by the iterator be actual resources, e.g. it is
acceptable to return names for which :meth:`is_resource` would
be false.

Allowing non-resource names to be returned is to allow for
situations where how a package and its resources are stored
are known a priori and the non-resource names would be useful.
For instance, returning subdirectory names is allowed so that
when it is known that the package and resources are stored on
the file system then those subdirectory names can be used
directly.

The abstract method returns an iterable of no items.


.. class:: Traversable
Expand Down
Loading
0