]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-133346: make `_colorize.Argparse` kw-only constructible (GH-140620) (#140621)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 26 Oct 2025 12:00:10 +0000 (13:00 +0100)
committerGitHub <noreply@github.com>
Sun, 26 Oct 2025 12:00:10 +0000 (12:00 +0000)
gh-133346: make `_colorize.Argparse` kw-only constructible (GH-140620)

Other themes are kw-only constructible.
(cherry picked from commit 387ac2d2f3a9de139d2e1ad5f0dc7996af015f54)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Lib/_colorize.py

index 4f510a7141b3d2999d3f1d4a107dc772eaa6f29c..766b2d8b80b1a4de0abc91174cb93de792e8354f 100644 (file)
@@ -155,7 +155,7 @@ class ThemeSection(Mapping[str, str]):
         return iter(self.__dataclass_fields__)
 
 
-@dataclass(frozen=True)
+@dataclass(frozen=True, kw_only=True)
 class Argparse(ThemeSection):
     usage: str = ANSIColors.BOLD_BLUE
     prog: str = ANSIColors.BOLD_MAGENTA