python: replace mypy with ty across lang/python and generated bindings - #64
Open
danepitkin wants to merge 11 commits into
Open
danepitkin wants to merge 11 commits into
danepitkin wants to merge 11 commits into
Conversation
- mechanics.md: replace mypy with ty and [tool.mypy] with [tool.ty] - house-rules.md (P5): replace "mypy passes" with "ty passes" - R1/example.md: replace "checked by mypy" with "checked by ty" and update # type: ignore syntax - H1/spelling.md: replace all instances of # type: ignore with # ty: ignore syntax, update [tool.mypy] to [tool.ty], and soften PGH003 claim to "loses its rule name"
… ignore Apply Rule B unconditionally across all files touched: bare # type: ignore → # ty: ignore.
…/python/examples/** Swaps the type-checker name from mypy to Astral's ty across rule falsifying-questions/canonical-example prose and the example write-ups that narrate them, converting diagnostic codes and ignore-comment syntax per the same mapping (arg-type -> invalid-argument-type, return-value -> invalid-return-type, # type: ignore -> # ty: ignore).
…comment-critic/** Apply Rule A (bare tool name) and Rule B (diagnostic/config mapping): - hard-limits.md: # type: ignore → # ty: ignore; [tool.mypy]/mypy.ini → [tool.ty]/ty.toml - routing-table.md: mypy return-value → ty invalid-return-type; mypy arg-type → ty invalid-argument-type - mechanical-issues.md: mypy arg-type/assignment → ty invalid-argument-type/invalid-assignment; # type: ignore → # ty: ignore - directives.md: # type: ignore → # ty: ignore
Swap the type-checker naming in the Python LDD skill prose from mypy to Astral's ty, following the same noun-vs-invocation and diagnostic/config mapping rules used elsewhere in this migration: bare `ty` when naming the tool, `ty check` for actual invocations, `[tool.ty]`/`ty.toml` for config, and renamed diagnostic codes (arg-type -> invalid-argument-type, etc.) and `# ty: ignore` suppressions.
Swaps the type-checker name from mypy to Astral's ty in the Python plugin's passthrough README/plugin.json/CHANGELOG, the repo-root README and marketplace.json, and docs/language-residue.md — noun mentions become ty, invocation-gated mentions become ty check, [tool.mypy]/mypy.ini become [tool.ty]/ty.toml, and # type: ignore becomes # ty: ignore with mapped diagnostic codes. Historical CHANGELOG entries for 0.1.0/0.2.0 are left untouched since they truthfully describe releases that shipped with mypy; a new [Unreleased] bullet announces the swap.
Line ~235's tool-chain sentence lists literal invocation forms (pytest, ruff check, ruff format), so ty belongs there as ty check, same as the sibling sentence in passthrough/README.md. The prior commit deferred to the brief's per-line "noun/config swap" label for this line instead of applying Rule A's invocation criterion to the sentence's actual structure; review correctly ruled the general substitution rule takes precedence.
…s/python.md for mypy→ty Regenerates the Python plugin's derived output (task generate BINDING=python) to pick up the mypy→ty swap made across lang/python/** and passthrough/** in prior tasks. task check, the mypy/type-ignore residue greps, and the generator's own drift check all pass.
Finding 1: mechanics.md's Type check row is command-shaped like its table neighbors, so it should show the literal `ty check` invocation, not the bare noun `ty`. Finding 2: the CHANGELOG's [Unreleased] bullet claimed a bare `ty check` with no targets fails like mypy does. It doesn't — ty checks the whole project from the pyproject.toml directory when given no paths. Drop the false claim, keep the still-true [tool.ty] gating language. Regenerated python-linter-driven-development/** and coding-rules/python.md via `task generate BINDING=python`; `task check` reports zero drift.
ty honors the standard PEP 484 `# type: ignore` comment as a suppression in addition to its own `# ty: ignore[<rule>]` syntax, unless explicitly disabled. A prior mechanical mypy->ty pass over-narrowed several detection/prohibition texts to only name `# ty: ignore`, which would miss a legacy `# type: ignore` a ty-using repo can legitimately still carry. Broaden the five detection/prohibition spots (lint-fixer hard limits, comment-critic's directive skip-list, R3's block-comment detection grep, pre-commit-review's in-context suppression check, and refactoring's nolint prohibition text + its executable grep) to name both spellings. Recommendation/example text that illustrates the `# ty: ignore` convention is left untouched, per the review's guidance. Verified the broadened grep `# *(noqa|(ty|type): *ignore)` against `# noqa: E501`, `# ty: ignore[invalid-return-type]`, bare `# ty: ignore`, `# type: ignore[assignment]`, and bare `# type: ignore` — all five match. Regenerated python-linter-driven-development/** via `task generate BINDING=python`; `task check` reports zero drift.
danepitkin
force-pushed
the
worktree-python-ty
branch
from
September 23, 2026 15:09
38205ec to
8fc52f2
Compare
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.
Summary
lang/python/(handbook, rules, examples, agents, commands, skills) and the shared passthrough/repo-root docs.python-linter-driven-development/,coding-rules/python.md) from the updated sources.tyinvocation form, accurate command/behavior claims, and detection of both# type: ignoreand# ty: ignoresuppression comments.Test plan
task generate BINDING=pythonrun and committed alongside source changestask check(drift check between sources and generated output)