-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Feature
When plugins add some methods or variables, it should be their responsibility to decide whether the override should be checked for LSP compat.
Pitch
This is already hitting the pydantic plugin, for example, resulting in some very weird workaround involving adding an unresolved classmethod
decorator that shouldn't be there at all.
In many cases a plugin-generated method has narrower signature than the base class definition, and there is no way to make it compatible with super definition (which can't be removed either to support other typecheckers). We still want a plugin to be able to define such a signature without introducing noise, assuming that the plugin author is already aware that such behavior violates LSP.
It should become easy to run LSP checks manually from plugin code. Checker API should be extended to include the necessary methods, or we'll see increased use of mypy internals or unexpectedly omitting LSP checks altogether because they are too tricky to implement correctly.