Skip to content

Commit 1f2cecc

Browse files
authored
distutils: Allow overriding Command and Distribution boolean attributes with actual bool in subclasses (#13615)
1 parent 041580d commit 1f2cecc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

stdlib/distutils/cmd.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ _CommandT = TypeVar("_CommandT", bound=Command)
3030
_Ts = TypeVarTuple("_Ts")
3131

3232
class Command:
33-
dry_run: Literal[0, 1] # Exposed from __getattr_. Same as Distribution.dry_run
33+
dry_run: bool | Literal[0, 1] # Exposed from __getattr_. Same as Distribution.dry_run
3434
distribution: Distribution
3535
# Any to work around variance issues
3636
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]

stdlib/distutils/dist.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ class Distribution:
8888
display_options: ClassVar[_OptionsList]
8989
display_option_names: ClassVar[list[str]]
9090
negative_opt: ClassVar[dict[str, str]]
91-
verbose: Literal[0, 1]
92-
dry_run: Literal[0, 1]
93-
help: Literal[0, 1]
91+
verbose: bool | Literal[0, 1]
92+
dry_run: bool | Literal[0, 1]
93+
help: bool | Literal[0, 1]
9494
command_packages: list[str] | None
9595
script_name: str | None
9696
script_args: list[str] | None

0 commit comments

Comments
 (0)