Skip to content

Add overloads to gen.multi(). Closes #3514. #3515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrheard
Copy link

@jrheard jrheard commented Jun 20, 2025

This diff resolves #3514 .

Repro file: https://github.com/jrheard/tornado-gen-repro/blob/main/main.py

When I install tornado's master branch and run mypy on that file, I get this output:

🚂  uv run mypy .
main.py:24: error: Argument 1 to "takes_list" has incompatible type "list[Any] | dict[Any, Any]"; expected "list[int]"  [arg-type]
main.py:25: error: Argument 1 to "takes_dict" has incompatible type "list[Any] | dict[Any, Any]"; expected "dict[str, int]"  [arg-type]
Found 2 errors in 1 file (checked 1 source file)

When I install this gen-multi-overload branch and run mypy on that file, I get this output:

🚂  uv run mypy .
Success: no issues found in 1 source file

This branch is clean on mypy 1.15.0:

🚂  mypy tornado
Success: no issues found in 75 source files

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.

gen.multi() return type isn't ergonomic
1 participant