Skip to content

Add missing type annotations - #74

Open
Danipulok wants to merge 4 commits into
pydantic:mainfrom
Danipulok:chore/type-annotations
Open

Add missing type annotations#74
Danipulok wants to merge 4 commits into
pydantic:mainfrom
Danipulok:chore/type-annotations

Conversation

@Danipulok

Copy link
Copy Markdown
Contributor

What

  • Annotate the parameters and returns that had none, so pyright no longer infers them as Unknown.
  • Remove not_print in run_code.py, which nothing calls.
  • Turn on four reportUnknown* rules so the gap cannot come back.
  • Pin pythonVersion = "3.10" to match requires-python.

Why

Most of the package was annotated already, but a handful of parameters and returns were not, and nothing in the toolchain reported them.

typeCheckingMode = "strict" would be the blunt way to enforce it, but it is down to 6 diagnostics on this branch and none of them is a missing annotation: three are fixtures pyright cannot see being called or used across modules, two are request.node, which pytest leaves untyped deliberately, and one is the deprecated co_lnotab getter. The four rules cover exactly what this change is about and nothing else.

The pythonVersion pin matters on its own: without it pyright checks against whatever interpreter the job installed, 3.12 in CI today, so a 3.11-only annotation passes make typecheck and only surfaces in the 3.10 test job, if at all.

How to test

make lint, make typecheck, and make test-all-python for 3.10 through 3.14. No behaviour change, so the existing suite is unchanged.

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