Use Final in tkinter (#12545)

This commit is contained in:
Max Muoto
2024-08-17 13:34:16 -07:00
committed by GitHub
parent 9ecd07a669
commit 82da1e19a7
4 changed files with 27 additions and 27 deletions

View File

@@ -1,12 +1,12 @@
from typing import Final
# These are not actually bools. See #4669
NO: bool
YES: bool
TRUE: bool
FALSE: bool
ON: bool
OFF: bool
NO: Final[bool]
YES: Final[bool]
TRUE: Final[bool]
FALSE: Final[bool]
ON: Final[bool]
OFF: Final[bool]
N: Final = "n"
S: Final = "s"
W: Final = "w"

View File

@@ -2,12 +2,12 @@ import sys
from _typeshed import Incomplete
from collections.abc import Mapping
from tkinter import Widget
from typing import Any
from typing import Any, Final
if sys.version_info >= (3, 9):
__all__ = ["Dialog"]
DIALOG_ICON: str
DIALOG_ICON: Final = "questhead"
class Dialog(Widget):
widgetName: str

View File

@@ -1,6 +1,6 @@
import sys
from tkinter.commondialog import Dialog
from typing import ClassVar
from typing import ClassVar, Final
if sys.version_info >= (3, 9):
__all__ = [
@@ -14,22 +14,22 @@ if sys.version_info >= (3, 9):
"askretrycancel",
]
ERROR: str
INFO: str
QUESTION: str
WARNING: str
ABORTRETRYIGNORE: str
OK: str
OKCANCEL: str
RETRYCANCEL: str
YESNO: str
YESNOCANCEL: str
ABORT: str
RETRY: str
IGNORE: str
CANCEL: str
YES: str
NO: str
ERROR: Final = "error"
INFO: Final = "info"
QUESTION: Final = "question"
WARNING: Final = "warning"
ABORTRETRYIGNORE: Final = "abortretryignore"
OK: Final = "ok"
OKCANCEL: Final = "okcancel"
RETRYCANCEL: Final = "retrycancel"
YESNO: Final = "yesno"
YESNOCANCEL: Final = "yesnocancel"
ABORT: Final = "abort"
RETRY: Final = "retry"
IGNORE: Final = "ignore"
CANCEL: Final = "cancel"
YES: Final = "yes"
NO: Final = "no"
class Message(Dialog):
command: ClassVar[str]