Skip to content

Commit

Permalink
make tkinter.font.Font behave similarly to tkinter widgets (#4469)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli authored Aug 24, 2020
1 parent 351a971 commit 39ddef2
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions stdlib/3/tkinter/font.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import tkinter
from typing import List, Optional, Tuple, TypeVar, Union, overload
from typing import Any, List, Optional, Tuple, TypeVar, Union, overload
from typing_extensions import Literal, TypedDict

NORMAL: Literal["normal"]
Expand Down Expand Up @@ -48,6 +48,8 @@ class Font:
underline: bool = ...,
overstrike: bool = ...,
) -> None: ...
def __getitem__(self, key: str) -> Any: ...
def __setitem__(self, key: str, value: Any) -> None: ...
@overload
def cget(self, option: Literal["family"]) -> str: ...
@overload
Expand All @@ -58,7 +60,6 @@ class Font:
def cget(self, option: Literal["slant"]) -> Literal["roman", "italic"]: ...
@overload
def cget(self, option: Literal["underline", "overstrike"]) -> Literal[0, 1]: ...
__getitem__ = cget
@overload
def actual(self, option: Literal["family"], displayof: Optional[tkinter.Misc] = ...) -> str: ...
@overload
Expand All @@ -73,18 +74,6 @@ class Font:
def actual(self, option: None, displayof: Optional[tkinter.Misc] = ...) -> _FontDict: ...
@overload
def actual(self, *, displayof: Optional[tkinter.Misc] = ...) -> _FontDict: ...
@overload
def __setitem__(self, key: Literal["family"], value: str) -> None: ...
@overload
def __setitem__(self, key: Literal["size"], value: int) -> None: ...
@overload
def __setitem__(self, key: Literal["weight"], value: Literal["normal", "bold"]) -> None: ...
@overload
def __setitem__(self, key: Literal["slant"], value: Literal["roman", "italic"]) -> None: ...
@overload
def __setitem__(self, key: Literal["underline"], value: bool) -> None: ...
@overload
def __setitem__(self, key: Literal["overstrike"], value: bool) -> None: ...
def config(
self,
*,
Expand Down

0 comments on commit 39ddef2

Please sign in to comment.