mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-04 04:25:50 +08:00
[configparser] Fix return type of RawConfigParser.read (#15551)
This commit is contained in:
+10
-3
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user