Skip to content

Commit a725f22

Browse files
author
David Robertson
committed
Fix contextmanager sample
Since python/mypy#13729, mypy complains if a non-abstract function has a trivial body. Avoid this providing a dummy body.
1 parent 591ba81 commit a725f22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/samples/contextmanager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class A(Generic[_T]):
99

1010
@contextmanager
1111
def m(x: _T) -> Iterator[A[_T]]:
12-
...
12+
return iter([A()])
1313

1414

1515
with m(7) as x:

0 commit comments

Comments
 (0)