Skip to content
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

chore(typing): fix mypy>=1.14.0 warnings #3739

Merged
merged 2 commits into from
Jan 2, 2025
Merged

Conversation

dangotbanned
Copy link
Member

@dangotbanned dangotbanned commented Jan 2, 2025

Resolves 2 new warnings that appeared after updating my env.

Warnings

tools/markup.py:71: error: Incompatible types in assignment (expression has type "str | list[dict[str, Any]]", variable has type "str")  [assignment]
            s = super().__call__(s)  # pyright: ignore[reportAssignmentType]
                ^~~~~~~~~~~~~~~~~~~
tools/markup.py:158: error: Incompatible return value type (got "str | list[dict[str, Any]]", expected "list[dict[str, Any]]")  [return-value]
        return tokens[0]
               ^~~~~~~~~
Found 2 errors in 1 file (checked 11 source files)

Additional

The second warning reminded me of (#3687 (comment)), so I've done some tidying up and opened a PR upstream

`pyright` had already detected this, but `mypy` has now caught up.

tools\markup.py:71: error: Incompatible types in assignment (expression has type "str | list[dict[str, Any]]", variable has type "str")  [assignment]             s = super().__call__(s)  # pyright: ignore[reportAssignmentType]                 ^~~~~~~~~~~~~~~~~~~
Also simplifies some of the surrounding **temporary** code
Warning:

tools\markup.py:158: error: Incompatible return value type (got "str | list[dict[str, Any]]", expected "list[dict[str, Any]]")  [return-value]         return tokens[0]                ^~~~~~~~~
@dangotbanned dangotbanned enabled auto-merge (squash) January 2, 2025 19:41
@dangotbanned dangotbanned merged commit 709bbdf into main Jan 2, 2025
26 checks passed
@dangotbanned dangotbanned mentioned this pull request Jan 16, 2025
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant