Skip to content

Commit bf9056e

Browse files
[lint] Fix RUF046 Value being cast to 'int' is already an integer
1 parent f9609c4 commit bf9056e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pylint/checkers/variables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3084,8 +3084,8 @@ def _get_value_length(value_node: nodes.NodeNG) -> int:
30843084
if isinstance(value_node, nodes.Subscript):
30853085
step = value_node.slice.step or 1
30863086
splice_range = value_node.slice.upper.value - value_node.slice.lower.value
3087-
splice_length = int(math.ceil(splice_range / step))
3088-
return splice_length
3087+
# RUF046 says the return of 'math.ceil' is always an int, mypy doesn't see it
3088+
return math.ceil(splice_range / step) # type: ignore[no-any-return]
30893089
return 1
30903090

30913091
@staticmethod

0 commit comments

Comments
 (0)