Commit 7576b0e
committed
fix(sentinel-graph): preserve narrowed token type for mypy 1.14
Return the locally-bound token (typed 'str') instead of cfg._token
(typed 'Optional[str]'). Functionally equivalent — token is assigned
to cfg._token on the previous line — but mypy 1.14 (the pinned mypy
on the Python 3.8 lockfile) does not narrow the field-access form and
flagged: 'Incompatible return value type (got str | None, expected str)'.
mypy 1.20+ (3.10+ lockfiles) accepted the original code, which is why
the failure was 3.8-specific. Verified clean with both mypy 1.14 and
1.20.2; sentinel-graph tests still pass.1 parent dadb444 commit 7576b0e
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
381 | | - | |
| 381 | + | |
| 382 | + | |
382 | 383 | | |
383 | 384 | | |
384 | 385 | | |
385 | | - | |
| 386 | + | |
386 | 387 | | |
387 | 388 | | |
388 | 389 | | |
| |||
0 commit comments