-
-
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
The following code shows a green square:
import tkinter
root = tkinter.Tk()
img = tkinter.PhotoImage(width=300, height=300)
img.put('green', to=(100, 100, 200, 200)) # This doesn't type-check like it should
tkinter.Label(root, image=img).pack()
root.mainloop()
When running type checker, there should be no errors, but I get a mypy error:
a.py:5: error: Argument "to" to "put" of "PhotoImage" has incompatible type "tuple[int, int, int, int]"; expected "tuple[int, int] | None" [arg-type]
Related: #13931
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