@@ -451,7 +451,9 @@ def infer_subscript(self, context=None):
451
451
452
452
@decorators .raise_if_nothing_inferred
453
453
@decorators .path_wrapper
454
- def _infer_boolop (self , context = None ):
454
+ def _infer_boolop (
455
+ self : nodes .BoolOp , context : InferenceContext | None = None , ** kwargs : Any
456
+ ) -> Generator [InferenceResult , None , InferenceErrorInfo | None ]:
455
457
"""Infer a boolean operation (and / or / not).
456
458
457
459
The function will calculate the boolean operation
@@ -465,12 +467,12 @@ def _infer_boolop(self, context=None):
465
467
predicate = operator .not_
466
468
467
469
try :
468
- values = [value .infer (context = context ) for value in values ]
470
+ inferred_values = [value .infer (context = context ) for value in values ]
469
471
except InferenceError :
470
472
yield util .Uninferable
471
473
return None
472
474
473
- for pair in itertools .product (* values ):
475
+ for pair in itertools .product (* inferred_values ):
474
476
if any (item is util .Uninferable for item in pair ):
475
477
# Can't infer the final result, just yield Uninferable.
476
478
yield util .Uninferable
@@ -499,10 +501,10 @@ def _infer_boolop(self, context=None):
499
501
else :
500
502
yield value
501
503
502
- return dict (node = self , context = context )
504
+ return InferenceErrorInfo (node = self , context = context )
503
505
504
506
505
- nodes .BoolOp ._infer = _infer_boolop
507
+ nodes .BoolOp ._infer = _infer_boolop # type: ignore[assignment]
506
508
507
509
508
510
# UnaryOp, BinOp and AugAssign inferences
0 commit comments