-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Remove redundant static typing casts #10612
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
Conversation
8ba17c5 to
d3f0164
Compare
|
i don't believe the CI failure is to do with this PR |
tk0miya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits.
| check_untyped_defs = True | ||
| warn_unused_ignores = True | ||
| strict_optional = False | ||
| no_implicit_optional = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this line?
|
|
||
| def apply(self, **kwargs: Any) -> None: | ||
| for node in self.document.findall(AliasNode): | ||
| node = cast(AliasNode, node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Our stubs surely provide nice annotation for findall()!
https://github.com/tk0miya/docutils-stubs/blob/b14071d065f8ee35399856fcaff6cd608294a342/docutils-stubs/nodes.pyi#L32-L33
|
I manually re-run failed tests :-) |
|
Thanks Dan! A |
remove redundant
typing.casts and updates mypy config to prevent these in future.type casts should only be used as a last resort, as they can mask errors if refactoring later changes the type of an object.