Skip to content

The "finder" Glossary Entry May Need Updating #118055

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

Closed
ericsnowcurrently opened this issue Apr 18, 2024 · 2 comments
Closed

The "finder" Glossary Entry May Need Updating #118055

ericsnowcurrently opened this issue Apr 18, 2024 · 2 comments
Labels
3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes docs Documentation in the Doc dir

Comments

@ericsnowcurrently
Copy link
Member

ericsnowcurrently commented Apr 18, 2024

Documentation

I'm referring to https://docs.python.org/3.13/glossary.html#term-finder.

(There are probably other import-related glossary entries that could use a similar update.)

(expand for extra context)

The glossary entry looks like so:

finder

An object that tries to find the [loader] for a module that is being imported.

Since Python 3.3, there are two types of finder: [meta path finders] for use
with [sys.meta_path], and [path entry finders] for use with [sys.path_hooks].

See [PEP 302], [PEP 420] and [PEP 451] for much more detail.

The glossary entry was added by @brettcannon in early 2009 (51d4aab), around the time he landed the initial importlib docs (afccd63), for Python 3.1.

Brett updated the entry, including the "Since 3.3" and the PEP references, in late 2015 (ccddbb1), before the 3.5 release.

PEP 302 landed in late 2002 (52e14d6), for Python 2.3 (not 3.3).

The "imports" page in the language reference was added by @warsaw in 2012 (dadebab), before the 3.3 release.

import system: https://docs.python.org/3.13/reference/import.html
importlib: https://docs.python.org/3.13/library/importlib.html


I happened to see the entry today and noticed two things:

  • it says "Since 3.3", but I'm pretty sure it should say "Since 2.3", which PEP 302 targeted (perhaps I missed something?)
  • along with (or even instead of) recommending the 3 PEPs, it would probably be even more helpful to refer to the language reference 1 and to the importlib docs page 2

Regarding the second point, the language reference and the importlib docs both would be better resources than the PEPs for explaining the various facets of the import system, including finders. PEP 302 even has a prominent warning about that.

FWIW, I had expected that the glossary entry predated that language reference page (2012) and importlib (2009), and that no one thought to update the glossary entry at the time. Having checked, that does correspond with the addition of the entry in early 2009, but not with the update in late 2015 that introduced the two bits of text I identified above. Since he committed both changes, perhaps @brettcannon has some insight into the "why" of the two parts of the glossary entry I identified above?

Linked PRs

Footnotes

  1. https://docs.python.org/3.13/reference/import.html

  2. https://docs.python.org/3.13/library/importlib.html

@ericsnowcurrently ericsnowcurrently added docs Documentation in the Doc dir 3.11 only security fixes 3.10 only security fixes 3.9 only security fixes 3.8 (EOL) end of life 3.12 only security fixes 3.13 bugs and security fixes labels Apr 18, 2024
@Lincoln-developer
Copy link
Contributor

hey I would love to work on this if you don't mind. Thanks.........

miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 30, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 30, 2024
encukou pushed a commit that referenced this issue May 30, 2024
…9774)

gh-118055: Update the finder glossary entry (GH-118278)
(cherry picked from commit db00934)

Co-authored-by: Lincoln <[email protected]>
encukou pushed a commit that referenced this issue May 30, 2024
…9773)

gh-118055: Update the finder glossary entry (GH-118278)
(cherry picked from commit db00934)

Co-authored-by: Lincoln <[email protected]>
@encukou encukou closed this as completed May 30, 2024
@ericsnowcurrently
Copy link
Member Author

Thanks @Lincoln-developer!

noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

3 participants