Skip to content

Commit 075de03

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d76cb3e commit 075de03

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

mypy/checkexpr.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Expression type checker. This file is conceptually part of TypeChecker."""
2-
from __future__ import annotations
32

4-
from mypy.types import Instance, get_proper_type
3+
from __future__ import annotations
54

65
import enum
76
import itertools
@@ -6275,13 +6274,12 @@ def visit_yield_from_expr(self, e: YieldFromExpr, allow_none_return: bool = Fals
62756274
# containing this `yield from` expression.
62766275
expected_item_type = self.chk.get_generator_yield_type(return_type, False)
62776276

6278-
62796277
iter_type_proper = get_proper_type(iter_type)
62806278

62816279
if isinstance(iter_type_proper, Instance) and iter_type_proper.args:
6282-
actual_item_type = iter_type_proper.args[0]
6280+
actual_item_type = iter_type_proper.args[0]
62836281
else:
6284-
actual_item_type = self.chk.get_generator_yield_type(iter_type_proper, False)
6282+
actual_item_type = self.chk.get_generator_yield_type(iter_type_proper, False)
62856283

62866284
self.chk.check_subtype(
62876285
actual_item_type,

test-data/unit/check-functions.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3778,4 +3778,4 @@ class A(Iterator[int]):
37783778
def __iter__(self) -> "A": ...
37793779

37803780
def f() -> Generator[tuple[int, ...], None, None]:
3781-
yield from A() # E: Incompatible types in "yield"
3781+
yield from A() # E: Incompatible types in "yield"

0 commit comments

Comments
 (0)