Skip to content

Set mypy to require full type annotation for all methods - #468

Open
gkreitz wants to merge 2 commits into
Kattis:masterfrom
gkreitz:mypy_require_types
Open

Set mypy to require full type annotation for all methods#468
gkreitz wants to merge 2 commits into
Kattis:masterfrom
gkreitz:mypy_require_types

Conversation

@gkreitz

@gkreitz gkreitz commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Sets disallow_untyped_defs = True, and adds missing type annotations. This prevents us from forgetting to add type annotations to new functions. Also sets disallow_untyped_decorators = True, not that I expect that we'll add a ton of decorators. The setting check_untyped_defs was dropped, as we now require all functions to be typed.

For code interacting with PlasTeX, we unfortunately end up with a ton of Any, as I don't think we have good documentation on what types we'll be called with.

One actual change in the code - in _build_junk_modifier I made the return value bool via a lambda to get a cleaner type annotation. Aside from that, PR is only type annotations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant