Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a couple missing tkinter things #13149

Merged
merged 8 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion stdlib/@tests/stubtest_allowlists/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ multiprocessing.pool.Pool.Process
multiprocessing.pool.ThreadPool.Process
multiprocessing.synchronize.Semaphore.get_value
tkinter.Misc.config
tkinter.font.Font.counter


# ==========
Expand Down
3 changes: 2 additions & 1 deletion stdlib/tkinter/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,8 @@ class Misc:
def __getitem__(self, key: str) -> Any: ...
def cget(self, key: str) -> Any: ...
def configure(self, cnf: Any = None) -> Any: ...
# TODO: config is an alias of configure, but adding that here creates lots of mypy errors
# TODO: config is an alias of configure, but adding that here creates
# conflict with the type of config in the subclasses. See #13149

class CallWrapper:
func: Incomplete
Expand Down
4 changes: 3 additions & 1 deletion stdlib/tkinter/font.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import _tkinter
import itertools
import sys
import tkinter
from typing import Any, Final, Literal, TypedDict, overload
from typing import Any, ClassVar, Final, Literal, TypedDict, overload
from typing_extensions import TypeAlias

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