@@ -186,7 +186,7 @@ def in_for_else_branch(parent, stmt):
186
186
187
187
@lru_cache (maxsize = 1000 )
188
188
def overridden_method (klass , name ):
189
- """get overridden method if any."""
189
+ """Get overridden method if any."""
190
190
try :
191
191
parent = next (klass .local_attr_ancestors (name ))
192
192
except (StopIteration , KeyError ):
@@ -578,8 +578,9 @@ def consumed(self):
578
578
579
579
@property
580
580
def consumed_uncertain (self ) -> DefaultDict [str , List [nodes .NodeNG ]]:
581
- """Retrieves nodes filtered out by get_next_to_consume() that may not have
582
- executed, such as statements in except blocks, or statements in try blocks (when
581
+ """Retrieves nodes filtered out by get_next_to_consume()
582
+
583
+ Those nodes may not have executed, such as statements in except blocks, or statements in try blocks (when
583
584
evaluating their corresponding except and finally blocks).
584
585
585
586
Checkers that want to treat the statements as executed (e.g. for unused-
@@ -1825,9 +1826,7 @@ def _is_first_level_self_reference(
1825
1826
def _is_never_evaluated (
1826
1827
defnode : nodes .NamedExpr , defnode_parent : nodes .IfExp
1827
1828
) -> bool :
1828
- """Check if a NamedExpr is inside a side of if ...
1829
-
1830
- else that never gets evaluated
1829
+ """Check if a NamedExpr is inside of an 'if else' that never gets evaluated
1831
1830
"""
1832
1831
inferred_test = utils .safe_infer (defnode_parent .test )
1833
1832
if isinstance (inferred_test , nodes .Const ):
0 commit comments