configparser: remove unnecessary defaults from overloads (#15641)

These overloads differ from the other overloads only in the presence
of the `fallback` parameter. If the parameter is not passed, the other
overload should be taken, so `fallback` should be made required on
these overloads for clarity.
This commit is contained in:
Jelle Zijlstra
2026-04-10 20:38:41 -07:00
committed by GitHub
parent f510e6cf4e
commit 46b01bf323
+3 -3
View File
@@ -289,19 +289,19 @@ class RawConfigParser(_Parser):
def getint(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> int: ...
@overload
def getint(
self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ...
self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T
) -> int | _T: ...
@overload
def getfloat(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> float: ...
@overload
def getfloat(
self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ...
self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T
) -> float | _T: ...
@overload
def getboolean(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> bool: ...
@overload
def getboolean(
self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ...
self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T
) -> bool | _T: ...
def _get_conv(
self,