From 0bca931e826879447301a06a3a49283109f7c237 Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Wed, 20 Mar 2024 20:57:58 +0100 Subject: [PATCH] Improve types in `utils.termcolors` (#1901) --- django-stubs/utils/termcolors.pyi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/django-stubs/utils/termcolors.pyi b/django-stubs/utils/termcolors.pyi index b466c6a57..bc75604a4 100644 --- a/django-stubs/utils/termcolors.pyi +++ b/django-stubs/utils/termcolors.pyi @@ -1,14 +1,14 @@ -from collections.abc import Callable, Mapping, Sequence -from typing import Any +from collections.abc import Callable, Sequence +from typing import Any, Literal -color_names: Sequence -foreground: Mapping[str, str] -background: Mapping[str, str] -RESET: str -opt_dict: Mapping[str, str] +color_names: tuple[str, ...] +foreground: dict[str, str] +background: dict[str, str] +RESET: Literal["0"] +opt_dict: dict[str, str] -def colorize(text: str | None = ..., opts: Sequence[str] = ..., **kwargs: Any) -> str: ... -def make_style(opts: tuple = ..., **kwargs: Any) -> Callable: ... +def colorize(text: str | None = ..., opts: Sequence[str] = ..., *, fg: str = ..., bg: str = ...) -> str: ... +def make_style(opts: Sequence[str] = ..., *, fg: str = ..., bg: str = ...) -> Callable[[str | None], str]: ... NOCOLOR_PALETTE: str DARK_PALETTE: str