+
Skip to content

Conversation

mdwelsh
Copy link
Contributor

@mdwelsh mdwelsh commented Oct 18, 2024

This PR fixes issues in the code that were leading to a bunch of mypy warnings. We now get no output from mypy when running on this branch (which is good).

It also replaces the test that was using reveal_type with the equivalent (and simpler) assert_type.

@mdwelsh mdwelsh requested review from HenryL27 and bsowell October 18, 2024 00:11
assert 'Revealed type is "builtins.int"' in mypy_res[0]
def test_mypy_type() -> None:
res = require_fn()
assert_type(res, int)
Copy link
Contributor

Choose a reason for hiding this comment

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

assert_type is only present in Python 3.11, so I would expect your unit tests to fail on 3.9 and 3.10.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out this does work if we import from typing_extensions!

@mdwelsh mdwelsh requested a review from bsowell October 18, 2024 05:29
Copy link
Contributor

@bsowell bsowell left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@mdwelsh mdwelsh merged commit 6f76f20 into main Oct 18, 2024
10 of 11 checks passed
@HenryL27 HenryL27 deleted the matt/fix-mypy-warnings branch August 30, 2025 00:03
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.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载