We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Report
mypy command on a misspecified subclass of a generic class returns a pretty confusing error message (As per issue #8696)
To Reproduce
from abc import ABC, abstractmethod from typing import TypeVar, Iterable, Iterator T = TypeVar('T') class MyABC(ABC): @property @abstractmethod def items(self) -> Iterable[T]: ... def my_method(self) -> Iterator[T]: for item in self.items: yield item
Expected Behavior
Since MyABC should inherit also from Generic[T] I'd expect that the error message would return something on the line of:
error: Incompatible types in "yield". The class should inherit from "Generic[T]"
Actual Behavior
The actual error message is:
error: Incompatible types in "yield" (actual type "T", expected type "T")
Environment
mypy.ini
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug Report
mypy command on a misspecified subclass of a generic class returns a pretty confusing error message (As per issue #8696)
To Reproduce
Expected Behavior
Since MyABC should inherit also from Generic[T] I'd expect that the error message would return something on the line of:
Actual Behavior
The actual error message is:
Environment
mypy.ini
(and other config files): defaultThe text was updated successfully, but these errors were encountered: