[configparser] Fix return type of RawConfigParser.read (#15551)

This commit is contained in:
LeonDeKunlun authored and GitHub committed 2026-03-26 11:22:48 +01:00
1 parent 96f56d072c
commit 4578526f87
1 file changed
+10 -3
+10 -3
View File
@@ -1,8 +1,8 @@
import sys
from _typeshed import MaybeNone, StrOrBytesPath, SupportsWrite
from _typeshed import BytesPath, GenericPath, MaybeNone, StrOrBytesPath, StrPath, SupportsWrite
from collections.abc import Callable, ItemsView, Iterable, Iterator, Mapping, MutableMapping, Sequence
from re import Pattern
from typing import Any, ClassVar, Final, Literal, TypeVar, overload, type_check_only
from typing import Any, AnyStr, ClassVar, Final, Literal, TypeVar, overload, type_check_only
from typing_extensions import TypeAlias, deprecated
if sys.version_info >= (3, 14):
@@ -269,7 +269,14 @@ class RawConfigParser(_Parser):
def has_section(self, section: _SectionName) -> bool: ...
def options(self, section: _SectionName) -> list[str]: ...
def has_option(self, section: _SectionName, option: str) -> bool: ...
def read(self, filenames: StrOrBytesPath | Iterable[StrOrBytesPath], encoding: str | None = None) -> list[str]: ...
@overload
def read(self, filenames: GenericPath[AnyStr], encoding: str | None = None) -> list[AnyStr]: ...
@overload
def read(self, filenames: Iterable[StrPath], encoding: str | None = None) -> list[str]: ...
@overload
def read(self, filenames: Iterable[BytesPath], encoding: str | None = None) -> list[bytes]: ...
@overload
def read(self, filenames: Iterable[StrOrBytesPath], encoding: str | None = None) -> list[str | bytes]: ...
def read_file(self, f: Iterable[str], source: str | None = None) -> None: ...
def read_string(self, string: str, source: str = "<string>") -> None: ...
def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], source: str = "<dict>") -> None: ...