Skip to content

Commit 4f47530

Browse files
committed
Use an assertion instead of a type ignore
1 parent 14613de commit 4f47530

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

astroid/brain/brain_hypothesis.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def a_strategy(draw):
1616
1717
a_strategy()
1818
"""
19+
from typing import TYPE_CHECKING
20+
1921
from astroid.manager import AstroidManager
2022
from astroid.nodes.scoped_nodes import FunctionDef
2123

@@ -41,7 +43,10 @@ def remove_draw_parameter_from_composite_strategy(node: FunctionDef) -> Function
4143
first argument (`draw`) - it's always supplied by Hypothesis so we don't
4244
need to emit the no-value-for-parameter lint.
4345
"""
44-
del node.args.args[0] # type: ignore[union-attr]
46+
if TYPE_CHECKING:
47+
assert isinstance(node.args.args, list)
48+
49+
del node.args.args[0]
4550
del node.args.annotations[0]
4651
del node.args.type_comment_args[0]
4752
return node

0 commit comments

Comments
 (0)