Skip to content

Commit af12250

Browse files
heikkitoivonencodex
andcommitted
Docs: Update stdlib email-errno
Co-Authored-By: Codex <codex@openai.com>
1 parent c7a1564 commit af12250

8 files changed

Lines changed: 101 additions & 10 deletions

File tree

DOCUMENTATION_STATUS.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ This document tracks the coverage of built-in functions, types, and standard lib
55
## Overview
66

77
- **Total Items**: 317 (150 builtins + 167 stdlib modules)
8-
- **Documented**: 375 (174 builtins + 201 stdlib)
9-
- **Coverage**: 118.3%
8+
- **Documented**: 376 (174 builtins + 202 stdlib)
9+
- **Coverage**: 118.6%
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

13-
Last updated: January 2026 (Python 3.14 audit)
13+
Last updated: January 27, 2026 (Python 3.14 audit)
1414

1515
## Built-in Types & Functions
1616

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

204204
## Standard Library Modules
205205

206-
**Coverage: 120.4% (201/167)**
206+
**Coverage: 121.0% (202/167)**
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

@@ -305,14 +305,15 @@ All file and I/O modules now documented:
305305
-`shutil` - High-level file operations
306306
-`tempfile` - Temporary files
307307

308-
### ✅ ALL MODULES COMPLETE (188/188)
308+
### ✅ ALL MODULES COMPLETE (202/202)
309309

310310
All 100 previously undocumented stdlib modules have been added:
311311

312-
**Utilities & System (18)**
312+
**Utilities & System (19)**
313313
-`ast` - Abstract syntax trees
314314
-`dis` - Disassembler for bytecode
315315
-`doctest` - Testing via docstrings
316+
-`errno` - Error number constants
316317
-`getopt` - Command-line option parsing
317318
-`gettext` - Internationalization
318319
-`keyword` - Python keywords

data/documentation_audit.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@
168168
},
169169
"stdlib": {
170170
"total": 167,
171-
"documented": 201,
172-
"coverage_percent": 120.4,
171+
"documented": 202,
172+
"coverage_percent": 121.0,
173173
"missing": [
174174
"audit_documentation",
175175
"cProfile",
@@ -179,7 +179,7 @@
179179
},
180180
"summary": {
181181
"total_items": 317,
182-
"total_documented": 375,
183-
"overall_coverage_percent": 118.3
182+
"total_documented": 376,
183+
"overall_coverage_percent": 118.6
184184
}
185185
}

docs/stdlib/email.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The `email` module provides utilities for constructing and parsing email message
66

77
| Operation | Time | Space | Notes |
88
|-----------|------|-------|-------|
9+
| `message_from_bytes()` | O(n) | O(n) | n = byte length |
10+
| `message_from_binary_file()` | O(n) | O(n) | n = file size |
911
| `message_from_string()` | O(n) | O(n) | n = email size |
1012
| `message_from_file()` | O(n) | O(n) | n = file size |
1113
| `email.parser.Parser()` | O(n) | O(n) | Parse email |

docs/stdlib/encodings.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ The `encodings` module provides Python's standard character encoding implementat
88
|-----------|------|-------|-------|
99
| Get encoding | O(1) | O(1) | Cache lookup |
1010
| Encode/decode | O(n) | O(n) | n = string length |
11+
| `normalize_encoding()` | O(n) | O(n) | n = name length |
12+
| `search_function()` | O(n) | O(1) | Normalizes then looks up |
13+
| `aliases` lookup | O(1) | O(1) | Dict access |
1114

1215
## Character Encodings
1316

docs/stdlib/ensurepip.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The `ensurepip` module bootstraps the pip package installer into Python installa
77
| Operation | Time | Space | Notes |
88
|-----------|------|-------|-------|
99
| `bootstrap()` | O(n) | O(n) | Install pip |
10+
| `version()` | O(1) | O(1) | Return bundled pip version string |
1011
| Verify | O(1) | O(1) | Check availability |
1112

1213
## Bootstrapping pip
@@ -19,6 +20,13 @@ import ensurepip
1920
# Bootstrap pip - O(n)
2021
ensurepip.bootstrap()
2122

23+
# Optional arguments (all keyword-only) - O(n)
24+
ensurepip.bootstrap(
25+
upgrade=True, # upgrade bundled pip
26+
default_pip=True, # install pip even if a "pipX" already exists
27+
verbosity=1, # pass through to pip
28+
)
29+
2230
# Or from command line:
2331
# python -m ensurepip
2432
# python -m ensurepip --upgrade

docs/stdlib/enum.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ The `enum` module provides a way to define a set of symbolic names (members) bou
1212
| Iteration `for e in EnumClass` | O(n) | O(1) | n = number of members |
1313
| `len(EnumClass)` | O(1) | O(1) | Cached member count |
1414
| `name` / `value` access | O(1) | O(1) | Direct attribute |
15+
| `auto()` | O(1) | O(1) | Auto-value sentinel |
16+
| `unique()` | O(n) | O(1) | Validate aliases in class |
17+
| `verify()` | O(n) | O(1) | Validate member constraints |
1518

1619
## Enum Basics
1720

docs/stdlib/errno.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# errno Module
2+
3+
The `errno` module provides platform-specific error number constants and an `errorcode` mapping
4+
for converting between numeric error codes and their symbolic names.
5+
6+
## Complexity Reference
7+
8+
| Operation | Time | Space | Notes |
9+
|-----------|------|-------|-------|
10+
| Access `E*` constant | O(1) | O(1) | Integer constant lookup |
11+
| `errorcode[err]` | O(1) | O(1) | Dict lookup for symbolic name |
12+
| Compare `exc.errno` | O(1) | O(1) | Integer compare |
13+
14+
!!! warning "Platform-dependent constants"
15+
`errno` values are OS-dependent. Some constants may be missing or have different numeric
16+
values across platforms.
17+
18+
## Common Operations
19+
20+
### Check an `OSError` by errno
21+
22+
```python
23+
import errno
24+
25+
try:
26+
with open("missing.txt", "r") as handle:
27+
data = handle.read()
28+
except OSError as exc:
29+
if exc.errno == errno.ENOENT:
30+
print("File not found")
31+
elif exc.errno == errno.EACCES:
32+
print("Permission denied")
33+
else:
34+
raise
35+
```
36+
37+
### Map an error code to its name
38+
39+
```python
40+
import errno
41+
42+
# O(1) lookup
43+
name = errno.errorcode[errno.ENOENT] # "ENOENT"
44+
```
45+
46+
### Use errno in filesystem helpers
47+
48+
```python
49+
import errno
50+
import os
51+
52+
try:
53+
os.remove("tmp.txt")
54+
except FileNotFoundError as exc:
55+
# FileNotFoundError derives from OSError
56+
if exc.errno == errno.ENOENT:
57+
pass
58+
```
59+
60+
## Public Constants
61+
62+
The module exposes many `E*` integer constants such as:
63+
64+
- `EACCES`, `EEXIST`, `EINVAL`, `EIO`, `ENOENT`, `ENOSPC`, `ENOTDIR`, `EPIPE`
65+
- Socket-related errors like `ECONNRESET`, `ECONNREFUSED`, `ETIMEDOUT`
66+
67+
Use `dir(errno)` to list all constants available on your platform.
68+
69+
## Related Documentation
70+
71+
- [os Module](os.md)
72+
- [stat Module](stat.md)
73+
- [pathlib Module](pathlib.md)

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ nav:
180180
- Deque: stdlib/deque.md
181181
- Defaultdict: stdlib/defaultdict.md
182182
- Enum: stdlib/enum.md
183+
- Errno: stdlib/errno.md
183184
- Fcntl: stdlib/fcntl.md
184185
- Filecmp: stdlib/filecmp.md
185186
- Fileinput: stdlib/fileinput.md

0 commit comments

Comments
 (0)