mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Return ItemsView/KeysView from Mapping methods (#6014)
* Return ItemsView/KeysView from Mapping methods * Make RawConfigParser compatible with Mapping
This commit is contained in:
@@ -1,23 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import StrOrBytesPath, StrPath, SupportsWrite
|
||||
from typing import (
|
||||
AbstractSet,
|
||||
Any,
|
||||
Callable,
|
||||
ClassVar,
|
||||
Dict,
|
||||
Iterable,
|
||||
Iterator,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
Optional,
|
||||
Pattern,
|
||||
Sequence,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
overload,
|
||||
)
|
||||
from collections.abc import Callable, ItemsView, Iterable, Iterator, Mapping, MutableMapping, Sequence
|
||||
from typing import Any, ClassVar, Dict, Optional, Pattern, Tuple, Type, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
# Internal type aliases
|
||||
@@ -143,9 +127,9 @@ class RawConfigParser(_parser):
|
||||
@overload
|
||||
def get(self, section: str, option: str, *, raw: bool = ..., vars: _section | None = ..., fallback: _T) -> str | _T: ...
|
||||
@overload
|
||||
def items(self, *, raw: bool = ..., vars: _section | None = ...) -> AbstractSet[Tuple[str, SectionProxy]]: ...
|
||||
def items(self, *, raw: bool = ..., vars: _section | None = ...) -> ItemsView[str, SectionProxy]: ...
|
||||
@overload
|
||||
def items(self, section: str, raw: bool = ..., vars: _section | None = ...) -> list[Tuple[str, str]]: ...
|
||||
def items(self, section: str, raw: bool = ..., vars: _section | None = ...) -> list[tuple[str, str]]: ...
|
||||
def set(self, section: str, option: str, value: str | None = ...) -> None: ...
|
||||
def write(self, fp: SupportsWrite[str], space_around_delimiters: bool = ...) -> None: ...
|
||||
def remove_option(self, section: str, option: str) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user