-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
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
Type checking for property.{fget,fset,fdel}
#1112
Comments
I'd actually been thinking about this recently, I think the best way to solve this moving forwards is for mypy to implement pyright's current behaviour (which is the correct one). Then to make FunctionType and MethodType generic as then users could actually opt-in to the descriptor behaviour if they wanted. The only issue with this is that currently this isn't do-able in the current type system (as far as I'm aware). |
It looks like both mypy and pyright are currently handling this case incorrectly. The signature of |
I don't think the |
I ran into this issue as well but it seems to only happen for properties with an additional decorator |
When trying to fix an issue in
typeshed
we found that bothmypy
andpyright
raised incorrect errors that were also inconsistent with one another so I'm creating this issue to facilitate further discussion on resolving this.mypy
:"Callable[[A], Any]" has no attribute "fget"
pyright
:Expected 0 positional arguments
Initial PR attempt and relevant discussions can be found here
The text was updated successfully, but these errors were encountered: