Improve override error note for LSP violations#21309
Open
dhruvmal128 wants to merge 1 commit intopython:masterfrom
Open
Improve override error note for LSP violations#21309dhruvmal128 wants to merge 1 commit intopython:masterfrom
dhruvmal128 wants to merge 1 commit intopython:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
80105a4 to
ffc8b09
Compare
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: steam.py (https://github.com/Gobot1234/steam.py)
+ steam/ext/csgo/client.py:55: note: This violates the Liskov substitution principle
+ steam/ext/tf2/client.py:52: note: This violates the Liskov substitution principle
discord.py (https://github.com/Rapptz/discord.py)
+ discord/invite.py:518: note: This violates the Liskov substitution principle
+ discord/channel.py:392: note: This violates the Liskov substitution principle
+ discord/channel.py:1544: note: This violates the Liskov substitution principle
+ discord/channel.py:1810: note: This violates the Liskov substitution principle
+ discord/channel.py:2079: note: This violates the Liskov substitution principle
+ discord/channel.py:2508: note: This violates the Liskov substitution principle
+ discord/ui/select.py:492: note: This violates the Liskov substitution principle
+ discord/ui/select.py:666: note: This violates the Liskov substitution principle
+ discord/ui/select.py:774: note: This violates the Liskov substitution principle
+ discord/ui/select.py:878: note: This violates the Liskov substitution principle
+ discord/ui/select.py:1007: note: This violates the Liskov substitution principle
Tanjun (https://github.com/FasterSpeeding/Tanjun)
+ tanjun/context/slash.py:1035: note: This violates the Liskov substitution principle
+ tanjun/context/message.py:134: note: This violates the Liskov substitution principle
+ tanjun/context/menu.py:102: note: This violates the Liskov substitution principle
jax (https://github.com/google/jax)
+ jax/_src/prng.py:348: note: This violates the Liskov substitution principle
apprise (https://github.com/caronc/apprise)
+ apprise/plugins/viber.py:181: note: This violates the Liskov substitution principle
+ apprise/plugins/mattermost.py:702: note: This violates the Liskov substitution principle
+ apprise/plugins/fluxer.py:857: note: This violates the Liskov substitution principle
+ apprise/plugins/discord.py:696: note: This violates the Liskov substitution principle
+ apprise/plugins/xmpp/base.py:296: note: This violates the Liskov substitution principle
+ apprise/plugins/xmpp/base.py:429: note: This violates the Liskov substitution principle
+ apprise/plugins/irc/base.py:392: note: This violates the Liskov substitution principle
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7994.
Adds a note explaining that incompatible method overrides violate the Liskov substitution principle. The existing error is preserved; this change only adds an explanatory note.
Testing:
python -m mypy /tmp/lsp_test.pybefore/afterpython runtests.py selfpython runtests.py lint