-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement new reportIncompatibleVariableOverride
#877
Comments
No, it would still flag the code as in error because a property is not the same as a variable. They have different semantics. However, the user could disable this rule if they don't care about those semantic differences. |
Oh, this is my mistake. I meant the other override issue we had talked about previously, which is #867. |
Correct. |
This is addressed in Pyright version 1.1.57, which I just published. It will also be included in the next version of Pylance. |
Pyright currently supports a diagnostic rule called
reportIncompatibleMethodOverride
that detects when a subclass overrides a base class method in an incompatible way.It would be useful to have a similar rule called
reportIncompatibleVariableOverride
that detects when a subclass declares an instance variable that is of an incompatible type. Properties and class variables will need to be taken into consideration.For more thoughts, refer to this issue: microsoft/pylance-release#157 (comment)
The text was updated successfully, but these errors were encountered: