Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Commit

Permalink
Change some tkinter function parameter types from bool to int. (pytho…
Browse files Browse the repository at this point in the history
…n#4765)

Change some tkinter function parameter types from bool to int.

Based on the fact that tk.{YES,NO,TRUE,FALSE} are defined as ints
and that the usage example in the source code also uses an int as a bool.
  • Loading branch information
rchen152 authored Nov 13, 2020
1 parent 536a5c6 commit a42f545
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stdlib/3/tkinter/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ _Padding = Union[
_Relief = Literal["raised", "sunken", "flat", "ridge", "solid", "groove"] # manual page: Tk_GetRelief
_ScreenUnits = Union[str, float] # manual page: Tk_GetPixels
_XYScrollCommand = Union[str, Callable[[float, float], Any]] # -xscrollcommand and -yscrollcommand in 'options' manual page
_TakeFocusValue = Union[bool, Literal[""], Callable[[str], Optional[bool]]] # -takefocus in manual page named 'options'
_TakeFocusValue = Union[int, Literal[""], Callable[[str], Optional[bool]]] # -takefocus in manual page named 'options'

class EventType(str, Enum):
Activate: str = ...
Expand Down Expand Up @@ -642,7 +642,7 @@ class Pack:
after: Misc = ...,
anchor: _Anchor = ...,
before: Misc = ...,
expand: bool = ...,
expand: int = ...,
fill: Literal["none", "x", "y", "both"] = ...,
side: Literal["left", "right", "top", "bottom"] = ...,
ipadx: Union[_ScreenUnits, Tuple[_ScreenUnits, _ScreenUnits]] = ...,
Expand Down Expand Up @@ -1685,7 +1685,7 @@ class Listbox(Widget, XView, YView):
borderwidth: _ScreenUnits = ...,
cursor: _Cursor = ...,
disabledforeground: _Color = ...,
exportselection: bool = ...,
exportselection: int = ...,
fg: _Color = ...,
font: _FontDescription = ...,
foreground: _Color = ...,
Expand Down Expand Up @@ -1831,7 +1831,7 @@ class Menu(Widget):
relief: _Relief = ...,
selectcolor: _Color = ...,
takefocus: _TakeFocusValue = ...,
tearoff: bool = ...,
tearoff: int = ...,
# I guess tearoffcommand arguments are supposed to be widget objects,
# but they are widget name strings. Use nametowidget() to handle the
# arguments of tearoffcommand.
Expand Down

0 comments on commit a42f545

Please sign in to comment.