-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
help wantedAn actionable problem of low to medium complexity where a PR would be very welcomeAn actionable problem of low to medium complexity where a PR would be very welcomestubs: false positiveType checkers report false errorsType checkers report false errorstopic: tkintertkinter-related issuestkinter-related issues
Description
At runtime, this displays the image with no errors. It should type-check without errors, but it doesn't.
import tkinter
with open("my_image.png", "rb") as file:
data = file.read()
label = tkinter.Label()
image = tkinter.PhotoImage()
image.put(data, to=(0, 0)) # This line is a mypy error
label.config(image=image)
label.pack()
tkinter.mainloop()Mypy error is:
asd.py:8: error: Argument 1 to "put" of "PhotoImage" has incompatible type "bytes"; expected "str | list[str] | list[list[str]] | list[tuple[str, ...]] | tuple[str, ...] | tuple[list[str], ...] | tuple[tuple[str, ...], ...]" [arg-type]
Metadata
Metadata
Assignees
Labels
help wantedAn actionable problem of low to medium complexity where a PR would be very welcomeAn actionable problem of low to medium complexity where a PR would be very welcomestubs: false positiveType checkers report false errorsType checkers report false errorstopic: tkintertkinter-related issuestkinter-related issues