这是indexloc提供的服务,不要输入任何密码
Skip to content

Fix typechecking errors that appeared under mypy release 1.16 #346

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

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Jun 2, 2025

Fix typechecking errors that appeared under mypy release 1.16

The following errors are now in GH Actions at HEAD:

absl/flags/_helpers.py:108: error: Argument 1 to "get" of "dict" has incompatible type "Any | None"; expected "str"  [arg-type]
absl/flags/_helpers.py:111: error: Argument 2 to "_ModuleObjectAndName" has incompatible type "str | Any | None"; expected "str"  [arg-type]
absl/testing/absltest.py:2745: error: Incompatible types in assignment (expression has type "str", variable has type "_T")  [assignment]

To resolve these errors more constructively, I also change the interface of _ModuleObjectAndName: instead of a tuple of Optionals, it's an Optional tuple now. The whole file is private, so changing the API is OK.

@copybara-service copybara-service bot changed the title Fix mypy errors Fix typechecking errors that appeared under mypy release 1.16 Jun 3, 2025
@copybara-service copybara-service bot force-pushed the test_766078875 branch 3 times, most recently from d73cc0a to d88f9cd Compare June 3, 2025 13:26
The following errors are now in GH Actions at HEAD:

    absl/flags/_helpers.py:108: error: Argument 1 to "get" of "dict" has incompatible type "Any | None"; expected "str"  [arg-type]
    absl/flags/_helpers.py:111: error: Argument 2 to "_ModuleObjectAndName" has incompatible type "str | Any | None"; expected "str"  [arg-type]
    absl/testing/absltest.py:2745: error: Incompatible types in assignment (expression has type "str", variable has type "_T")  [assignment]

To resolve these errors more constructively, I also change the interface of `_ModuleObjectAndName`: instead of a tuple of Optionals, it's an Optional tuple now. The whole file is private, so changing the API is OK.

PiperOrigin-RevId: 766637390
@copybara-service copybara-service bot merged commit 55c8f4d into main Jun 3, 2025
@copybara-service copybara-service bot deleted the test_766078875 branch June 3, 2025 13:31
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