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
from dataclasses import dataclass from typing import Generic, Protocol, TypeVar import pandas as pd _DataFrameBound = TypeVar("_DataFrameBound", bound=pd.DataFrame, covariant=True) class _Method(Protocol[_DataFrameBound]): def __call__(self, dataframe: pd.DataFrame) -> _DataFrameBound: ... @dataclass class MyClass(Generic[_DataFrameBound]): _method: _Method[_DataFrameBound] @dataclass class MyClassDataFrame(MyClass[pd.DataFrame]): ... def function(dataframe: pd.DataFrame) -> pd.DataFrame: return pd.DataFrame() my_class = MyClassDataFrame(function)
is failing with
error: Argument 1 to "MyClassDataFrame" has incompatible type "Callable[[DataFrame], DataFrame]"; expected "_Method[_DataFrameBound]" [arg-type]
and Pyright see it as a valid code so I think it should be seen as valid by mypy.
0.931
poetry run mypy --no-warn-unused-ignores --show-error-codes
mypy.ini
strict = true
3.8.10
The text was updated successfully, but these errors were encountered:
Related pyright discussion : microsoft/pyright#3090
Sorry, something went wrong.
Thanks, I think this got fixed a while back, in 0.950 from #12656
No branches or pull requests
is failing with
and Pyright see it as a valid code so I think it should be seen as valid by mypy.
0.931
poetry run mypy --no-warn-unused-ignores --show-error-codes
mypy.ini
(and other config files):strict = true
3.8.10
The text was updated successfully, but these errors were encountered: