FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Ignore a few override errors in typeshed by JukkaL · Pull Request #19079 · python/mypy · GitHub

Repository navigation

Ignore a few override errors in typeshed - #19079

Merged
JukkaL merged 1 commit into
masterfrom
typeshed-ignore-override
May 12, 2025
Merged

JukkaL merged 1 commit into
masterfrom
typeshed-ignore-override

Conversation

JukkaL commented May 12, 2025

Copy link
Copy Markdown
Collaborator

I was seeing errors like these in our Bazel-based mypy configuration, which may type check typeshed in some non-standard way:

mypy/typeshed/stdlib/tempfile.pyi:390: error: Argument 1 of "writelines" is incompatible with supertype "_IOBase"; supertype defines the argument type as "Iterable[Buffer]"  [override]
mypy/typeshed/stdlib/tempfile.pyi:390: note: This violates the Liskov substitution principle
mypy/typeshed/stdlib/tempfile.pyi:390: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
mypy/typeshed/stdlib/tkinter/ttk.pyi:565: error: Signature of "forget" incompatible with supertype "Pack"  [override]
mypy/typeshed/stdlib/tkinter/ttk.pyi:565: note:      Superclass:
mypy/typeshed/stdlib/tkinter/ttk.pyi:565: note:          def pack_forget(self) -> None
mypy/typeshed/stdlib/tkinter/ttk.pyi:565: note:      Subclass:
mypy/typeshed/stdlib/tkinter/ttk.pyi:565: note:          def forget(self, tab_id: Any) -> None

I'm just merging this directly to the mypy repo so that I can move forward more quickly, as this is needed to unblock the public release.

I was seeing errors like these in our Bazel-based mypy configuration, which
may type check typeshed in some non-standard way:
```
mypy/typeshed/stdlib/tempfile.pyi:390: error: Argument 1 of "writelines" is incompatible with supertype "_IOBase"; supertype defines the argument type as "Iterable[Buffer]"  [override]
mypy/typeshed/stdlib/tempfile.pyi:390: note: This violates the Liskov substitution principle
mypy/typeshed/stdlib/tempfile.pyi:390: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
mypy/typeshed/stdlib/tkinter/ttk.pyi:565: error: Signature of "forget" incompatible with supertype "Pack"  [override]
mypy/typeshed/stdlib/tkinter/ttk.pyi:565: note:      Superclass:
mypy/typeshed/stdlib/tkinter/ttk.pyi:565: note:          def pack_forget(self) -> None
mypy/typeshed/stdlib/tkinter/ttk.pyi:565: note:      Subclass:
mypy/typeshed/stdlib/tkinter/ttk.pyi:565: note:          def forget(self, tab_id: Any) -> None
```

I'm just merging this directly to the mypy repo so that I can move
forward more quickly, as this is needed to unblock the public release.
JukkaL merged commit 52975f6 into master May 12, 2025
JukkaL deleted the typeshed-ignore-override branch May 12, 2025 13:31

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Copy Markdown
Member

This is going to cause issues with the next automatic mypy sync. We could add another patch to the sync workflow but that will make future maintenance harder.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL