Skip to content

Conversation

@jrheard
Copy link
Contributor

@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

Copy link
Member

@bdarnell bdarnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but the linter has a complaint about blank lines.

@jrheard jrheard requested a review from bdarnell July 2, 2025 03:05
@bdarnell bdarnell merged commit a800ee4 into tornadoweb:master Jul 2, 2025
15 checks passed
bdarnell pushed a commit to bdarnell/tornado that referenced this pull request Aug 7, 2025
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

2 participants