Skip to content

Commit d7a8d80

Browse files
heikkitoivonencodex
andcommitted
Update: remove non-public stdlib docs
Co-Authored-By: Codex <codex@openai.com>
1 parent 32960b1 commit d7a8d80

10 files changed

Lines changed: 49 additions & 174 deletions

DOCUMENTATION_STATUS.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ This document tracks the coverage of built-in functions, types, and standard lib
44

55
## Overview
66

7-
- **Total Items**: 317 (150 builtins + 167 stdlib modules)
8-
- **Documented**: 389 (174 builtins + 215 stdlib)
9-
- **Coverage**: 122.7%
7+
- **Total Items**: 313 (150 builtins + 163 stdlib modules)
8+
- **Documented**: 385 (174 builtins + 211 stdlib)
9+
- **Coverage**: 123.0%
1010

1111
**Note**: Coverage exceeds 100% because comprehensive documentation files (like `exceptions.md`) cover multiple individual items, and we document deprecated/removed modules for historical reference.
1212

@@ -203,7 +203,7 @@ Complete coverage of all built-in functions, types, exceptions, and constants:
203203

204204
## Standard Library Modules
205205

206-
**Coverage: 128.7% (215/167)**
206+
**Coverage: 129.4% (211/163)**
207207

208208
All standard library modules are fully documented, including new Python 3.14 modules. Coverage exceeds 100% due to documentation of deprecated/removed modules for historical reference.
209209

@@ -226,9 +226,9 @@ All standard library modules are fully documented, including new Python 3.14 mod
226226
-`sndhdr` - Sound file format detection
227227
-`select` - I/O multiplexing
228228

229-
### ⊘ Excluded Items (4 - intentionally out of scope)
229+
### ⊘ Excluded Items (8 - intentionally out of scope)
230230

231-
These items appear in audit but are **intentionally not documented** as they are not part of Python's standard library:
231+
These items are **intentionally not documented** and excluded from coverage calculations:
232232

233233
**Project Scripts** (not stdlib):
234234
- `audit_documentation` - Project's own audit script
@@ -237,6 +237,12 @@ These items appear in audit but are **intentionally not documented** as they are
237237
**Third-party Packages** (external, not stdlib):
238238
- `pip` - External package manager
239239

240+
**Internal (non-public) stdlib modules**:
241+
- `pydoc_data` - Internal pydoc data
242+
- `sre_compile` - Internal regex compiler
243+
- `sre_constants` - Internal regex constants
244+
- `sre_parse` - Internal regex parser
245+
240246
**Case Sensitivity**:
241247
- `cProfile` - Already documented as `cprofile.md`
242248

@@ -306,9 +312,9 @@ All file and I/O modules now documented:
306312
-`shutil` - High-level file operations
307313
-`tempfile` - Temporary files
308314

309-
### ✅ ALL MODULES COMPLETE (215/215)
315+
### ✅ ALL MODULES COMPLETE (211/211)
310316

311-
All 112 previously undocumented stdlib modules have been added:
317+
All 108 previously undocumented stdlib modules have been added:
312318

313319
**Utilities & System (22)**
314320
-`ast` - Abstract syntax trees
@@ -376,7 +382,7 @@ All 112 previously undocumented stdlib modules have been added:
376382
**Memory Mapping (1)**
377383
-`mmap` - Memory-mapped file access
378384

379-
**Parsing & Compilation (13)**
385+
**Parsing & Compilation (10)**
380386
-`codeop` - Compile Python source
381387
-`code` - Code evaluation
382388
-`py_compile` - Compilation
@@ -385,9 +391,6 @@ All 112 previously undocumented stdlib modules have been added:
385391
-`modulefinder` - Module dependencies
386392
-`opcode` - Python opcodes
387393
-`pyclbr` - Class/function browser
388-
-`sre_compile` - Regular expression compilation
389-
-`sre_constants` - Regex constants
390-
-`sre_parse` - Regex parsing
391394
-`symtable` - Symbol table
392395
-`token` - Token types
393396

@@ -408,12 +411,11 @@ All 112 previously undocumented stdlib modules have been added:
408411
-`wsgiref` - WSGI utilities
409412
-`zipapp` - ZIP application creation
410413

411-
**Development & Meta (9)**
414+
**Development & Meta (8)**
412415
-`antigravity` - Easter egg
413416
-`bdb` - Debugger framework
414417
-`cmd` - Interactive command interfaces
415418
-`compileall` - Batch compilation
416-
-`pydoc_data` - Pydoc data
417419
-`rlcompleter` - Readline completion
418420
-`tabnanny` - Python indentation checker
419421
-`this` - Zen of Python

data/documentation_audit.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@
167167
}
168168
},
169169
"stdlib": {
170-
"total": 167,
171-
"documented": 215,
172-
"coverage_percent": 128.7,
170+
"total": 163,
171+
"documented": 211,
172+
"coverage_percent": 129.4,
173173
"missing": [
174174
"audit_documentation",
175175
"cProfile",
@@ -178,8 +178,8 @@
178178
]
179179
},
180180
"summary": {
181-
"total_items": 317,
182-
"total_documented": 389,
183-
"overall_coverage_percent": 122.7
181+
"total_items": 313,
182+
"total_documented": 385,
183+
"overall_coverage_percent": 123.0
184184
}
185185
}

docs/stdlib/pydoc_data.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/stdlib/sre_compile.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

docs/stdlib/sre_constants.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

docs/stdlib/sre_parse.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

mkdocs.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ nav:
241241
- Pstats: stdlib/pstats.md
242242
- Pyclbr: stdlib/pyclbr.md
243243
- Pydoc: stdlib/pydoc.md
244-
- Pydoc_data: stdlib/pydoc_data.md
245244
- Py_compile: stdlib/py_compile.md
246245
- Pyexpat: stdlib/pyexpat.md
247246
- Namedtuple: stdlib/namedtuple.md
@@ -281,9 +280,6 @@ nav:
281280
- Smtpd: stdlib/smtpd.md
282281
- Smtplib: stdlib/smtplib.md
283282
- Sndhdr: stdlib/sndhdr.md
284-
- Sre_compile: stdlib/sre_compile.md
285-
- Sre_constants: stdlib/sre_constants.md
286-
- Sre_parse: stdlib/sre_parse.md
287283
- Ssl: stdlib/ssl.md
288284
- Stat: stdlib/stat.md
289285
- Statistics: stdlib/statistics.md

scripts/audit_documentation.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,16 @@ def get_all_builtins() -> dict[str, list[str]]:
4242
def get_all_stdlib_modules() -> list[str]:
4343
"""Get list of all standard library modules."""
4444
stdlib_modules: list[str] = []
45+
non_public = {
46+
"pydoc_data",
47+
"sre_compile",
48+
"sre_constants",
49+
"sre_parse",
50+
}
4551

4652
for _importer, modname, _ispkg in pkgutil.iter_modules():
4753
# Filter to main stdlib modules (no underscores at start)
48-
if not modname.startswith("_"):
54+
if not modname.startswith("_") and modname not in non_public:
4955
stdlib_modules.append(modname)
5056

5157
return sorted(stdlib_modules)

scripts/introspect.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ def suppress_stdout():
2424
def get_stdlib_modules() -> list[str]:
2525
"""Get all stdlib module names, sorted alphabetically."""
2626
if hasattr(sys, "stdlib_module_names"):
27-
return sorted(sys.stdlib_module_names)
27+
non_public = {
28+
"pydoc_data",
29+
"sre_compile",
30+
"sre_constants",
31+
"sre_parse",
32+
}
33+
return sorted(name for name in sys.stdlib_module_names if name not in non_public)
2834
raise RuntimeError("Python 3.10+ required for sys.stdlib_module_names")
2935

3036

tests/test_introspect.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ def test_includes_common_modules(self) -> None:
217217
assert "sys" in modules
218218
assert "json" in modules
219219

220+
def test_excludes_non_public_modules(self) -> None:
221+
modules = get_stdlib_modules()
222+
non_public = ["pydoc_data", "sre_compile", "sre_constants", "sre_parse"]
223+
for mod in non_public:
224+
assert mod not in modules
225+
220226

221227
class TestBuildItemList:
222228
"""Tests for build_item_list function."""
@@ -257,6 +263,13 @@ def test_excludes_private_stdlib_modules(self) -> None:
257263
for mod in private_modules:
258264
assert mod not in names, f"Private module {mod} should be excluded"
259265

266+
def test_excludes_non_public_stdlib_modules(self) -> None:
267+
items = build_item_list()
268+
names = [name for name, _ in items]
269+
non_public = ["pydoc_data", "sre_compile", "sre_constants", "sre_parse"]
270+
for mod in non_public:
271+
assert mod not in names, f"Non-public module {mod} should be excluded"
272+
260273
def test_includes_dunder_stdlib_modules(self) -> None:
261274
"""Dunder modules like __future__ should be included."""
262275
items = build_item_list()

0 commit comments

Comments
 (0)