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
When subclassing property and returning a generic type, mypy reveals <nothing> as the type of the property. Pyright reveals the expected type.
property
<nothing>
To Reproduce
from typing import Any, Generic, Optional, Type, TypeVar T = TypeVar("T") class customProperty(property, Generic[T]): def __get__(self, obj: Any, owner: Optional[Type] = None) -> T: return super().__get__(obj, owner) class C: @customProperty def prop(self) -> int: return 1 reveal_type(C().prop)
Expected Behavior
Revealed type is "builtins.int"
Actual Behavior
Revealed type is "<nothing>"
Your Environment
mypy.ini
Pyright 1.1.244 however seems to get it right and returns the expected type Type of "C().prop" is "int"
Type of "C().prop" is "int"
This could be related to #11115
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug Report
When subclassing
property
and returning a generic type, mypy reveals<nothing>
as the type of the property.Pyright reveals the expected type.
To Reproduce
Expected Behavior
Revealed type is "builtins.int"
Actual Behavior
Revealed type is "<nothing>"
Your Environment
mypy.ini
(and other config files): nonePyright 1.1.244 however seems to get it right and returns the expected type
Type of "C().prop" is "int"
This could be related to #11115
The text was updated successfully, but these errors were encountered: