You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Activity
ericsnowcurrently commentedon Nov 28, 2013
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.
PCManticore commentedon Nov 28, 2013
It was used by pydoc.py until 2006, when it was removed with this commit:
Changeset:
37821 (3135648026c4) Second phase of refactoring for runpy, pkgutil, pydoc, and setuptools.
Is it worth to fix this?
PCManticore commentedon Jun 25, 2014
I would go on the deprecation route with this and removing it in 3.6, just like the formatter module.
[-]pydoc.ispackage() could be more accurate[/-][+]deprecate pydoc.ispackage()[/+]hugovk commentedon May 5, 2023
Searching the top 5k PyPI packages shows only a single use:
gh-64020: Deprecate pydoc.ispackage() (GH-20908)
pythongh-64020: Deprecate pydoc.ispackage() (pythonGH-20908)
pythongh-64020: Deprecate pydoc.ispackage() (pythonGH-20908)
pythongh-64020: Deprecate pydoc.ispackage() (pythonGH-20908)