Skip to content

Commit 1ba0a31

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

8 files changed

Lines changed: 24 additions & 0 deletions

File tree

COMPLETENESS_REVIEW_PROMPT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ For each documented module or type:
7777

7878
3. **Update documentation for gaps**
7979
- Add missing methods to the documentation with their complexity
80+
- Do not add new documentation sections to existing files; update existing sections only
8081
- If a method is intentionally omitted, add a comment explaining why
8182

8283
## Example Review Process

docs/stdlib/fcntl.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ The `fcntl` module provides access to file control operations on Unix, including
88
|-----------|------|-------|-------|
99
| `flock()` | O(1) | O(1) | Acquire lock; blocks if contended (without LOCK_NB) |
1010
| `fcntl()` | O(1) | O(1) | File control operation |
11+
| `ioctl()` | O(1) | O(1) | Device-specific I/O control |
12+
| `lockf()` | O(1) | O(1) | POSIX record locking |
1113

1214
## File Locking and Control
1315

docs/stdlib/filecmp.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ The `filecmp` module provides tools for comparing files and directories, with sh
1212
| `dircmp()` init | O(1) | O(1) | Create directory comparator |
1313
| `dircmp.report()` | O(k*n) | O(k) | k = files, n = avg size |
1414
| `dircmp.report_full_closure()` | O(k*d*n) | O(k*d) | Recursive, d = depth |
15+
| `clear_cache()` | O(1) | O(1) | Clear comparison cache |
16+
| `demo()` | O(1) | O(1) | Run module demo (I/O bound) |
1517

1618
## File Comparison
1719

docs/stdlib/fileinput.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ The `fileinput` module provides an iterator for processing lines from multiple i
1111
| `filename()` | O(1) | O(1) | Get current file name |
1212
| `filelineno()` | O(1) | O(1) | Get current line in file |
1313
| `lineno()` | O(1) | O(1) | Get total line count |
14+
| `fileno()` | O(1) | O(1) | Get current file descriptor |
15+
| `isfirstline()` | O(1) | O(1) | Check first line of file |
16+
| `isstdin()` | O(1) | O(1) | Check if current file is stdin |
17+
| `nextfile()` | O(1) | O(1) | Skip to next file |
1418
| `close()` | O(1) | O(1) | Close file iterator |
19+
| `FileInput(...)` | O(1) | O(1) | Create iterator instance |
20+
| `hook_encoded()` | O(1) | O(1) | Encoding open hook factory |
21+
| `hook_compressed()` | O(1) | O(1) | Compressed-file open hook factory |
1522

1623
## Basic Line Iteration
1724

docs/stdlib/fnmatch.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The `fnmatch` module provides Unix filename pattern matching using shell-style w
1010
| `fnmatchcase()` | O(n) | O(1) | Case-sensitive version |
1111
| `filter()` | O(k*n) | O(k) | k = items, n = string length |
1212
| `translate()` | O(n) | O(n) | Convert pattern to regex |
13+
| `filterfalse()` | O(k*n) | O(k) | Invert filter results |
1314

1415
## Pattern Matching
1516

docs/stdlib/fractions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ The `fractions` module provides support for rational number arithmetic, maintain
1111
| `Fraction` comparison | O(1) | O(1) | Cross-multiplication (a*d vs b*c) |
1212
| `Fraction` conversion | O(log n) | O(1) | GCD for reduction |
1313
| `limit_denominator()` | O(k) | O(1) | k = max denominator |
14+
| `Fraction.from_float()` | O(log n) | O(1) | Convert float to exact fraction |
15+
| `Fraction.from_decimal()` | O(log n) | O(1) | Convert Decimal to exact fraction |
1416

1517
## Basic Usage
1618

docs/stdlib/ftplib.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ The `ftplib` module implements FTP client functionality for transferring files t
99
| `connect()` | O(1) | O(1) | TCP connection |
1010
| List files | O(n) | O(n) | n = files |
1111
| Transfer | O(n) | O(n) | n = file size |
12+
| `FTP()` | O(1) | O(1) | Create client (optional connect) |
13+
| `FTP_TLS()` | O(1) | O(1) | Create FTPS client |
14+
| `parse227()` | O(1) | O(1) | Parse PASV reply |
15+
| `parse229()` | O(1) | O(1) | Parse EPSV reply |
16+
| `parse257()` | O(n) | O(1) | Parse PWD reply |
1217

1318
## Connecting and Transferring Files
1419

docs/stdlib/functools.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The `functools` module provides higher-order functions and operations on callabl
1111
| `lru_cache(maxsize)` | O(1) avg hit, O(f(n)) miss | O(min(n, maxsize)) | Hit is O(1) avg (hash-based); miss runs wrapped function |
1212
| `cache()` | O(1) avg hit, O(f(n)) miss | O(n) unbounded | Hit is O(1) avg (hash-based); miss runs wrapped function |
1313
| `cached_property` | O(1) after first call | O(1) per property | Descriptor cache |
14+
| `get_cache_token()` | O(1) | O(1) | Token changes when cache state changes |
1415

1516
### Function Composition
1617

@@ -21,6 +22,7 @@ The `functools` module provides higher-order functions and operations on callabl
2122
| `partialmethod(func, *args)` | O(1) | O(k) for k args | Partial for use as method descriptor |
2223
| `wraps(wrapped)` | O(1) | O(1) | Decorator to copy function metadata |
2324
| `update_wrapper(wrapper, wrapped)` | O(1) | O(1) | Copy function metadata (used by wraps) |
25+
| `recursive_repr()` | O(1) | O(1) | Prevent recursive __repr__ loops |
2426

2527
### Comparison Helpers
2628

@@ -216,6 +218,7 @@ class MyClass:
216218
return sum(range(1000000))
217219
```
218220

221+
219222
## Performance Characteristics
220223

221224
### When to Use Cache
@@ -320,6 +323,7 @@ process(5) # "Integer: 10"
320323
process([1,2,3]) # "List of 3 items"
321324
```
322325

326+
323327
## Version Notes
324328

325329
- **Python 2.5+**: `reduce`, `partial`

0 commit comments

Comments
 (0)