Using precise code for pyright: ignore and re-enabling various pyright tests (#12576)

This commit is contained in:
Avasam
2024-08-21 21:34:52 -04:00
committed by GitHub
parent 2404a70f2b
commit 3719f02dbf
18 changed files with 60 additions and 75 deletions

View File

@@ -1,20 +1,20 @@
# Verify that ImageTK images are valid to pass to TK code.
from __future__ import annotations
# The following tests don't work at the moment, due to pyright getting
# The following tests don't work on pyright at the moment, due to it getting
# confused by the existence of these stubs and annotations in the actual
# Pillow package.
# https://github.com/python/typeshed/issues/11688
# pyright: reportArgumentType=false
import tkinter
# import tkinter
from PIL import ImageTk
# from PIL import ImageTk
photo = ImageTk.PhotoImage()
bitmap = ImageTk.BitmapImage()
# photo = ImageTk.PhotoImage()
# bitmap = ImageTk.BitmapImage()
tkinter.Label(image=photo)
tkinter.Label(image=bitmap)
# tkinter.Label(image=photo)
# tkinter.Label(image=bitmap)
# tkinter.Label().configure(image=photo)
# tkinter.Label().configure(image=bitmap)
tkinter.Label().configure(image=photo)
tkinter.Label().configure(image=bitmap)