Skip to content

Commit 2ccc53b

Browse files
authored
Add a couple missing tkinter things (python#13149)
1 parent cba73d9 commit 2ccc53b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

stdlib/@tests/stubtest_allowlists/common.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ multiprocessing.pool.Pool.Process
9595
multiprocessing.pool.ThreadPool.Process
9696
multiprocessing.synchronize.Semaphore.get_value
9797
tkinter.Misc.config
98-
tkinter.font.Font.counter
9998

10099

101100
# ==========

stdlib/tkinter/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,8 @@ class Misc:
627627
def __getitem__(self, key: str) -> Any: ...
628628
def cget(self, key: str) -> Any: ...
629629
def configure(self, cnf: Any = None) -> Any: ...
630-
# TODO: config is an alias of configure, but adding that here creates lots of mypy errors
630+
# TODO: config is an alias of configure, but adding that here creates
631+
# conflict with the type of config in the subclasses. See #13149
631632

632633
class CallWrapper:
633634
func: Incomplete

stdlib/tkinter/font.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import _tkinter
2+
import itertools
23
import sys
34
import tkinter
4-
from typing import Any, Final, Literal, TypedDict, overload
5+
from typing import Any, ClassVar, Final, Literal, TypedDict, overload
56
from typing_extensions import TypeAlias
67

78
if sys.version_info >= (3, 9):
@@ -40,6 +41,7 @@ class _MetricsDict(TypedDict):
4041
class Font:
4142
name: str
4243
delete_font: bool
44+
counter: ClassVar[itertools.count[int]] # undocumented
4345
def __init__(
4446
self,
4547
# In tkinter, 'root' refers to tkinter.Tk by convention, but the code

0 commit comments

Comments
 (0)