GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-93610: Improve docs for importlib.resources by encukou · Pull Request #93611 · python/cpython

Conversation

@encukou

@encukou encukou commented Jun 8, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This PR aims to make importlib.resources docs more usable.
@jaraco, do these look reasonable?


Please, if you have suggestions for more improvements, use the issue (or another PR). This PR does not aim to make the docs perfect, just better.

  • Issue: Better docs for importlib.resources #93610

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
encukou added 13 commits June 8, 2022 19:14
@encukou
Add a concrete example of why you'd use importlib.resources over Path…
6a97526
…(__file__)
@encukou
Link to the definition of a new term
77b50ae
@encukou
Add importlib.resources.abc docs to the hierarchy, to fix links
89f00a2
@encukou
Package: Document what this is first, then give the formal definition
9134901
@encukou
Shorten links to Traversable
0274515
@encukou
Link to Package
39ab32a
@encukou
Move deprecated functions to a dedicated section, add modern equivalents
521ad26
@encukou
Move replacements to the ..deprecated sections
719562b
@encukou
Remove the link to migrating legacy usage: this is now documented here.
9bcca6b
@encukou
Remove errors arguments from the migration snippets
ac007c3
@encukou
Fix qualname of importlib.resources.abc.ResourceReader
d1fefcb
@encukou
Reword the intro for deprecated functions
993ea9e
@encukou
Remove unnecessary "headings"
77acd33
@encukou encukou added the skip news label Jun 8, 2022
@encukou
encukou requested a review from jaraco June 8, 2022 17:27
@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting core review labels Jun 8, 2022
@encukou encukou mentioned this pull request Jun 8, 2022
Better docs for importlib.resources #93610
Closed
slateny
slateny reviewed Jun 9, 2022
View reviewed changes
Comment thread Doc/library/importlib.resources.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

AA-Turner
AA-Turner reviewed Jun 9, 2022
View reviewed changes

@AA-Turner AA-Turner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing major:

A

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/importlib.resources.abc.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/importlib.resources.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/importlib.resources.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/importlib.resources.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/importlib.resources.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/importlib.resources.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/importlib.resources.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/importlib.resources.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/importlib.resources.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/importlib.resources.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@encukou @AA-Turner @slateny
Apply suggestions from code review
1fb51a0
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Stanley <[email protected]>
AA-Turner
AA-Turner approved these changes Jun 9, 2022
View reviewed changes
@AA-Turner AA-Turner added the topic-importlib label Jun 9, 2022
@encukou

encukou commented Jun 16, 2022

Copy link
Copy Markdown
Member Author

Hm, I see the mistake I made here: I moved all of importlib.abc to a new file, but in reality that page should be split between importlib.abc and importlib.resources.abc.
One day I'll learn how this package works, but it's not today!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

encukou added 2 commits June 16, 2022 17:47
@encukou
Move classes that are actually in importlib.abc out from importlib.re…
a5a5377
…sources.abc
@encukou
Fix references to classes in importlib.resources.abc
a03df1f
@encukou

encukou commented Jun 16, 2022

Copy link
Copy Markdown
Member Author

Here's a fix.
There's a remaining reference to a importlib.abc.TraversableReader, which is undocumented and actually lives in the undocumented module importlib.resources.simple, but declare that out of scope of this PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner

AA-Turner commented Jun 16, 2022

Copy link
Copy Markdown
Member

It might make sense to break out importlib.abc to its own page, but out of scope for this importlib.resouces-specific PR.

A

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@warsaw warsaw mentioned this pull request Jul 4, 2022
gh-93963: Document importlib.abc deprecations #94546
Merged
@ambv
Merge remote-tracking branch 'upstream/main' into impres-docs
85ad3c7
@ambv
Slightly reword Package
fa68025
@ambv ambv added the needs backport to 3.11 only security fixes label Jul 25, 2022
@ambv
ambv merged commit ccd7c7a into python:main Jul 25, 2022
@bedevere-bot bedevere-bot removed the awaiting core review label Jul 25, 2022
@miss-islington

miss-islington commented Jul 25, 2022

Copy link
Copy Markdown
Contributor

Thanks @encukou for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 25, 2022
@bedevere-bot

bedevere-bot commented Jul 25, 2022

Copy link
Copy Markdown

GH-95247 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 25, 2022
@encukou @miss-islington
pythongh-93610: Improve docs for importlib.resources (pythonGH-93611)
f448394
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Stanley <[email protected]>
Co-authored-by: Łukasz Langa <[email protected]>
(cherry picked from commit ccd7c7a)

Co-authored-by: Petr Viktorin <[email protected]>
ambv added a commit that referenced this pull request Jul 25, 2022
@miss-islington @encukou
@AA-Turner @slateny @ambv
gh-93610: Improve docs for importlib.resources (GH-93611) (GH-95247)
9217051
(cherry picked from commit ccd7c7a)

Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Stanley <[email protected]>
Co-authored-by: Łukasz Langa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@slateny slateny slateny left review comments
@AA-Turner AA-Turner AA-Turner approved these changes
@jaraco jaraco Awaiting requested review from jaraco jaraco is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news topic-importlib

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@encukou @AA-Turner @miss-islington @bedevere-bot @slateny @ambv
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.