-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
deprecate pydoc.ispackage() #64020
Comments
pydoc.ispackage() is a best-effort guess at whether or not a path is the location of a package. However, it uses hard-coded suffixes when matching file names, which can miss files (e.g. extension modules and sourceless packages on Windows). It should probably use suffixes defined in importlib.util, as they're used elsewhere in pydoc. The function also does not comprehend namespace packages, but I'm not sure that's worth worrying about. FWIW, it isn't clear to me what is using pydoc.ispackage(). It may not be used in the stdlib at all. |
It was used by pydoc.py until 2006, when it was removed with this commit: Changeset: Is it worth to fix this? |
I would go on the deprecation route with this and removing it in 3.6, just like the formatter module. |
Searching the top 5k PyPI packages shows only a single use: ❯ python3 ~/github/misc/cpython/search_pypi_top.py -q . "pydoc.*ispackage"
./PyDispatcher-2.0.7.tar.gz: PyDispatcher-2.0.7/docs/pydoc/pydoc2.py: elif pydoc.ispackage(path):
./PyDispatcher-2.0.7.tar.gz: PyDispatcher-2.0.7/docs/pydoc/pydoc2.py: elif pydoc.ispackage(path): |
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: