Skip to content

Commit

Permalink
Use an assertion instead of a type ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
correctmost committed Sep 5, 2024
1 parent 14613de commit 4f47530
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion astroid/brain/brain_hypothesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def a_strategy(draw):
a_strategy()
"""
from typing import TYPE_CHECKING

from astroid.manager import AstroidManager
from astroid.nodes.scoped_nodes import FunctionDef

Expand All @@ -41,7 +43,10 @@ def remove_draw_parameter_from_composite_strategy(node: FunctionDef) -> Function
first argument (`draw`) - it's always supplied by Hypothesis so we don't
need to emit the no-value-for-parameter lint.
"""
del node.args.args[0] # type: ignore[union-attr]
if TYPE_CHECKING:
assert isinstance(node.args.args, list)

del node.args.args[0]
del node.args.annotations[0]
del node.args.type_comment_args[0]
return node
Expand Down

0 comments on commit 4f47530

Please sign in to comment.