From 1f2ceccfae10e1107514d2d972fda741cd257165 Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 11 Mar 2025 06:18:03 -0400 Subject: [PATCH] distutils: Allow overriding Command and Distribution boolean attributes with actual bool in subclasses (#13615) --- stdlib/distutils/cmd.pyi | 2 +- stdlib/distutils/dist.pyi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/distutils/cmd.pyi b/stdlib/distutils/cmd.pyi index dcb423a49..a4e77ddf1 100644 --- a/stdlib/distutils/cmd.pyi +++ b/stdlib/distutils/cmd.pyi @@ -30,7 +30,7 @@ _CommandT = TypeVar("_CommandT", bound=Command) _Ts = TypeVarTuple("_Ts") class Command: - dry_run: Literal[0, 1] # Exposed from __getattr_. Same as Distribution.dry_run + dry_run: bool | Literal[0, 1] # Exposed from __getattr_. Same as Distribution.dry_run distribution: Distribution # Any to work around variance issues sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] diff --git a/stdlib/distutils/dist.pyi b/stdlib/distutils/dist.pyi index 75fc7dbb3..09f2b456d 100644 --- a/stdlib/distutils/dist.pyi +++ b/stdlib/distutils/dist.pyi @@ -88,9 +88,9 @@ class Distribution: display_options: ClassVar[_OptionsList] display_option_names: ClassVar[list[str]] negative_opt: ClassVar[dict[str, str]] - verbose: Literal[0, 1] - dry_run: Literal[0, 1] - help: Literal[0, 1] + verbose: bool | Literal[0, 1] + dry_run: bool | Literal[0, 1] + help: bool | Literal[0, 1] command_packages: list[str] | None script_name: str | None script_args: list[str] | None