Add types to tkinter.colorchooser.askcolor (#8588)

This commit is contained in:
Akuli
2022-08-22 19:15:37 +03:00
committed by GitHub
parent 976fdae300
commit 5ea1b1e6de
2 changed files with 10 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import sys
from tkinter import Misc, _Color
from tkinter.commondialog import Dialog
from typing import ClassVar
@@ -8,4 +9,12 @@ if sys.version_info >= (3, 9):
class Chooser(Dialog):
command: ClassVar[str]
def askcolor(color: str | bytes | None = ..., **options) -> tuple[None, None] | tuple[tuple[float, float, float], str]: ...
if sys.version_info >= (3, 9):
def askcolor(
color: str | bytes | None = ..., *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ...
) -> tuple[None, None] | tuple[tuple[int, int, int], str]: ...
else:
def askcolor(
color: str | bytes | None = ..., *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ...
) -> tuple[None, None] | tuple[tuple[float, float, float], str]: ...