8000 Ignore a few override errors in typeshed by JukkaL · Pull Request #19079 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Ignore a few override errors in typeshed#19079

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

Ignore a few override errors in typeshed#19079
JukkaL merged 1 commit intomasterfrom
typeshed-ignore-override

Conversation

@JukkaL
Copy link
Collaborator
@JukkaL JukkaL commented May 12, 2025

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 JukkaL merged commit 52975f6 into master May 12, 2025
17 checks passed
@JukkaL JukkaL deleted the typeshed-ignore-override branch May 12, 2025 13:31
@github-actions
Copy link
Contributor

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

@JelleZijlstra
Copy link
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.

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

0