Title: pydoc.ispackage() could be more accurate
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.5
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Claudiu.Popa, ZackerySpytz, eric.snow, wolma
Priority: low Keywords: patch

Created on 2013-11-28 07:55 by eric.snow, last changed 2020-06-16 05:47 by ZackerySpytz.

Pull Requests
URL Status Linked Edit
PR 20908 open ZackerySpytz, 2020-06-16 05:47
Messages (3)
msg204646 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2013-11-28 07:55
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.
msg204697 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2013-11-28 21:02
It was used by until 2006, when it was removed with this commit: 

37821 (3135648026c4) Second phase of refactoring for runpy, pkgutil, pydoc, and setuptools.

Is it worth to fix this?
msg221548 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-06-25 13:27
I would go on the deprecation route with this and removing it in 3.6, just like the formatter module.
Date User Action Args
2020-06-16 05:47:10ZackerySpytzsetkeywords: + patch
nosy: + ZackerySpytz

pull_requests: + pull_request20090
stage: needs patch -> patch review
2017-03-10 07:18:37wolmasetnosy: + wolma
2014-06-25 13:27:02Claudiu.Popasetmessages: + msg221548
2013-11-28 21:03:00Claudiu.Popasetnosy: + Claudiu.Popa
messages: + msg204697
2013-11-28 07:55:30eric.snowcreate