Skip to content

Commit 38d7c8b

Browse files
committed
Tweak generator function return type error wording
1 parent eec57e6 commit 38d7c8b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mypy/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
INVALID_EXCEPTION = 'Exception must be derived from BaseException'
3131
INVALID_EXCEPTION_TYPE = 'Exception type must be derived from BaseException'
3232
INVALID_RETURN_TYPE_FOR_YIELD = \
33-
'The return type of a generator function should be "Generator" or a supertype thereof'
33+
'The return type of a generator function should be "Generator" or one of its supertypes'
3434
INVALID_RETURN_TYPE_FOR_YIELD_FROM = \
3535
'Iterable function return type expected for "yield from"'
3636
INCOMPATIBLE_TYPES = 'Incompatible types'

mypy/test/data/check-statements.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ def f() -> Any:
676676
[case testYieldInFunctionReturningFunction]
677677
from typing import Callable
678678
def f() -> Callable[[], None]:
679-
yield object() # E: The return type of a generator function should be "Generator" or a supertype thereof
679+
yield object() # E: The return type of a generator function should be "Generator" or one of its supertypes
680680
[out]
681681
main: note: In function "f":
682682

@@ -688,7 +688,7 @@ def f():
688688
[case testWithInvalidInstanceReturnType]
689689
import typing
690690
def f() -> int:
691-
yield 1 # E: The return type of a generator function should be "Generator" or a supertype thereof
691+
yield 1 # E: The return type of a generator function should be "Generator" or one of its supertypes
692692
[builtins fixtures/for.py]
693693
[out]
694694
main: note: In function "f":

0 commit comments

Comments
 (0)