From 37d4e4bde0ec1dd02229ebce5e4421090c098662 Mon Sep 17 00:00:00 2001 From: ANSHUL SINGH <72524975+ekanshul@users.noreply.github.com> Date: Thu, 20 Aug 2026 02:18:22 +0530 Subject: [PATCH] configparser: allow default_section=None Co-Authored-By: Claude Fable 5 --- stdlib/configparser.pyi | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/stdlib/configparser.pyi b/stdlib/configparser.pyi index 385336ec154a..622df65ccc49 100644 --- a/stdlib/configparser.pyi +++ b/stdlib/configparser.pyi @@ -154,7 +154,7 @@ class RawConfigParser(_Parser): NONSPACECRE: ClassVar[Pattern[str]] # undocumented BOOLEAN_STATES: ClassVar[Mapping[str, bool]] # undocumented - default_section: str + default_section: str | None if sys.version_info >= (3, 13): @overload def __init__( @@ -168,7 +168,7 @@ class RawConfigParser(_Parser): inline_comment_prefixes: Sequence[str] | None = None, strict: bool = True, empty_lines_in_values: bool = True, - default_section: str = "DEFAULT", + default_section: str | None = "DEFAULT", interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., allow_unnamed_section: bool = False, @@ -185,7 +185,7 @@ class RawConfigParser(_Parser): inline_comment_prefixes: Sequence[str] | None = None, strict: bool = True, empty_lines_in_values: bool = True, - default_section: str = "DEFAULT", + default_section: str | None = "DEFAULT", interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., allow_unnamed_section: bool = False, @@ -202,7 +202,7 @@ class RawConfigParser(_Parser): inline_comment_prefixes: Sequence[str] | None = None, strict: bool = True, empty_lines_in_values: bool = True, - default_section: str = "DEFAULT", + default_section: str | None = "DEFAULT", interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., allow_unnamed_section: bool = False, @@ -220,7 +220,7 @@ class RawConfigParser(_Parser): inline_comment_prefixes: Sequence[str] | None = None, strict: bool = True, empty_lines_in_values: bool = True, - default_section: str = "DEFAULT", + default_section: str | None = "DEFAULT", interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., ) -> None: ... @@ -236,7 +236,7 @@ class RawConfigParser(_Parser): inline_comment_prefixes: Sequence[str] | None = None, strict: bool = True, empty_lines_in_values: bool = True, - default_section: str = "DEFAULT", + default_section: str | None = "DEFAULT", interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., ) -> None: ... @@ -252,7 +252,7 @@ class RawConfigParser(_Parser): inline_comment_prefixes: Sequence[str] | None = None, strict: bool = True, empty_lines_in_values: bool = True, - default_section: str = "DEFAULT", + default_section: str | None = "DEFAULT", interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., ) -> None: ...