mypy: clear gently/mesh/* type errors (Phase 4 of #49)#59
Open
subindevs wants to merge 1 commit into
Open
Conversation
Type the mesh cluster (15 errors / 3 modules) and drop its entries from the [[tool.mypy.overrides]] ignore list. - peer_client.py (13 union-attr): _ensure_session() now returns the non-None aiohttp.ClientSession; call sites use the returned local instead of self._session, so mypy can prove non-None. Behavior unchanged. - discovery.py (override): widen _MeshProtocol.connection_made to BaseTransport to match asyncio.BaseProtocol, narrowing to DatagramTransport via assert. - capability_provider.py (attr-defined): targeted ignore for the Windows-only ctypes.windll in the platform-guarded branch. mypy . is clean (300 files, deps-less, as CI runs); ruff check/format pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 4 of the incremental mypy effort (#49) — takes the
gently/mesh/*cluster (15 errors / 3 modules) to clean and removes its entries from[[tool.mypy.overrides]].Chose mesh as the first Phase-4 slice because it's the smallest self-contained cluster and low-risk. Deliberately skipped the denser
gently/dataset/*cluster since #16 plans to retire that legacy SQLite code.Changes
peer_client.pyunion-attrself._session: ClientSession | Noneused after_ensure_session()._ensure_session()now returns the non-None session; the 12 call sites use the returned local instead ofself._session, so mypy can prove non-None. Behavior unchanged.discovery.pyoverride_MeshProtocol.connection_madenarrowed the param vsasyncio.BaseProtocol. Widened toBaseTransport(matches supertype) +assert isinstance(..., DatagramTransport)to narrow for the typed attribute.capability_provider.pyattr-definedctypes.windllis Windows-only in typeshed; targeted# type: ignore[attr-defined]on the already platform-guarded branch.pyproject.tomlVerification
mypy .— no issues in 300 source files (deps-less, as CI runs)ruff check+ruff format --check— cleanPart of #49.
🤖 Generated with Claude Code