Skip to content

Conversation

@danieleades
Copy link
Contributor

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.

@danieleades danieleades force-pushed the refactor/redundant-cast branch from 8ba17c5 to d3f0164 Compare July 1, 2022 14:56
@danieleades
Copy link
Contributor Author

i don't believe the CI failure is to do with this PR

Copy link
Member

@tk0miya tk0miya left a 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
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

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

@tk0miya tk0miya added this to the 5.1.0 milestone Jul 2, 2022
@tk0miya
Copy link
Member

tk0miya commented Jul 2, 2022

I manually re-run failed tests :-)

@AA-Turner AA-Turner changed the title remove redundant casts Remove redundant static typing casts Jul 2, 2022
@AA-Turner AA-Turner merged commit 13fb174 into sphinx-doc:5.x Jul 2, 2022
@AA-Turner
Copy link
Member

Thanks Dan!

A

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants