Skip to content

gh-89679: improve TraversableResources's documentation #29174

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FFY00
Copy link
Member

@FFY00 FFY00 commented Oct 22, 2021

This was my attempt at rewriting TraversableResources description to make it a bit clearer to people who are not familiar with the other protocols. I don't think I did a great job, but hopefully is a bit better.

Does anyone have any suggestions on how to improve this?

https://bugs.python.org/issue45516

@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label Oct 22, 2021
@FFY00 FFY00 requested review from jaraco and brettcannon October 22, 2021 21:11
@FFY00 FFY00 force-pushed the bpo-45516-traversableresources-docstring branch from a960d23 to 3df59ff Compare October 22, 2021 21:12
@FFY00
Copy link
Member Author

FFY00 commented Oct 22, 2021

@layday do you have any suggestions?

Signed-off-by: Filipe Laíns <lains@riseup.net>
@FFY00 FFY00 force-pushed the bpo-45516-traversableresources-docstring branch from 3df59ff to a9815ee Compare October 22, 2021 21:14
@layday
Copy link

layday commented Oct 23, 2021

I'd reword this completely - it's far too verbose and fails to get the message across:

    An abstract base class implementing :class:`importlib.abc.ResourceReader`
    for :class:`importlib.abc.Traversable` objects, and defining one
    abstract method, :meth:`files`, which must return such an object.
    Loaders are expected to implement this ABC for resource reading,
    instead of implementing :class:`importlib.abc.ResourceReader` directly,
    to interface with :meth:`importlib.resources.files`.

Document the files method:

.. abstractmethod:: files()

   An abstract method to return a :class:`importlib.abc.Traversable`
   instance for the package's resources.

Drag the ResourceReader section down underneath Traversable and remove the "superseded by" blurb from ResourceReader. The ResourceReader's description might also need adjusting.

@brettcannon brettcannon removed their request for review November 16, 2021 19:37
@iritkatriel
Copy link
Member

https://bugs.python.org/issue45516 is closed. What is the status of this PR?

@FFY00
Copy link
Member Author

FFY00 commented Apr 11, 2022

Hi @iritkatriel, it is still relevant, but I am not sure if I will pick this up again soon.

@iritkatriel
Copy link
Member

Ok, I reopened the issue on GitHub.

@StanFromIreland StanFromIreland changed the title bpo-45516: improve TraversableResources's documentation gh-89679: improve TraversableResources's documentation Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

6 participants