Skip to content

Commit

Permalink
fixup! Fix FP
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Apr 16, 2023
1 parent a152b76 commit e968a12
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pylint/checkers/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,15 +824,12 @@ def _uncertain_nodes_in_false_tests(

@staticmethod
def _node_guarded_by_same_test(node: nodes.NodeNG, other_if: nodes.If) -> bool:
"""Identify if `node` is guarded by an equivalent test as `other_if`,
and neither of the tests is a Name.
"""Identify if `node` is guarded by an equivalent test as `other_if`.
Two tests are equivalent if their string representations are identical
or if their inferred values consist only of constants and those constants
are identical.
are identical, and the if test guarding `node` is not a Name.
"""
if isinstance(other_if.test, nodes.Name):
return False
other_if_test_as_string = other_if.test.as_string()
other_if_test_all_inferred = utils.infer_all(other_if.test)
for ancestor in node.node_ancestors():
Expand Down

0 comments on commit e968a12

Please sign in to comment.