From 903f74a68ed227431cf4400682d69c17da80acc4 Mon Sep 17 00:00:00 2001 From: Akuli Date: Mon, 15 Feb 2021 17:52:06 +0200 Subject: [PATCH] tkinter.Tk.eval self fix (#5023) Fixes #5019 --- stdlib/tkinter/__init__.pyi | 2 +- tests/stubtest_whitelists/py3_common.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index 6b7d32080..39fc85191 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -645,7 +645,7 @@ class Tk(Misc, Wm): # Tk has __getattr__ so that tk_instance.foo falls back to tk_instance.tk.foo # Please keep in sync with _tkinter.TkappType call: Callable[..., Any] - eval: Callable[[str], str] + def eval(self, __code: str) -> str: ... adderrorinfo: Any createcommand: Any createfilehandler: Any diff --git a/tests/stubtest_whitelists/py3_common.txt b/tests/stubtest_whitelists/py3_common.txt index 2fb874204..d3c882822 100644 --- a/tests/stubtest_whitelists/py3_common.txt +++ b/tests/stubtest_whitelists/py3_common.txt @@ -382,6 +382,7 @@ threading.Thread.__init__ timeit.main tkinter.Misc.grid_propagate tkinter.Misc.pack_propagate +tkinter.Tk.eval # from __getattr__ tkinter.Tk.report_callback_exception # A bit of a lie, since it's actually a method, but typing it as an attribute allows it to be assigned to tkinter.Wm.wm_iconphoto # Default value of argument can't be used without runtime error tkinter.font.Font.__getitem__ # Argument name differs (doesn't matter for __dunder__ methods)