[issue19821] pydoc.ispackage() could be more accurate

Eric Snow report at bugs.python.org
Thu Nov 28 08:55:30 CET 2013


New submission from Eric Snow:

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.

----------
components: Library (Lib)
messages: 204646
nosy: eric.snow
priority: low
severity: normal
stage: needs patch
status: open
title: pydoc.ispackage() could be more accurate
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19821>
_______________________________________


More information about the Python-bugs-list mailing list