mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-24 18:48:46 +08:00
@@ -1,17 +1,21 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Iterator, Mapping as DictMixin
|
||||
from typing import TypeVar
|
||||
|
||||
class LazyDict(DictMixin[str, Incomplete]):
|
||||
data: dict[str, Incomplete] | None
|
||||
def __getitem__(self, key: str) -> Incomplete: ...
|
||||
_T = TypeVar("_T")
|
||||
_VT = TypeVar("_VT")
|
||||
|
||||
class LazyDict(DictMixin[str, _VT]):
|
||||
data: dict[str, _VT] | None
|
||||
def __getitem__(self, key: str) -> _VT: ...
|
||||
def __contains__(self, key: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
class LazyList(list[Incomplete]):
|
||||
class LazyList(list[_T]):
|
||||
# does not return `Self` type:
|
||||
def __new__(cls, fill_iter: Incomplete | None = None) -> LazyList: ... # noqa: Y034
|
||||
def __new__(cls, fill_iter: Incomplete | None = None) -> LazyList[_T]: ...
|
||||
|
||||
class LazySet(set[Incomplete]):
|
||||
class LazySet(set[_T]):
|
||||
# does not return `Self` type:
|
||||
def __new__(cls, fill_iter: Incomplete | None = None) -> LazySet: ... # noqa: Y034
|
||||
def __new__(cls, fill_iter: Incomplete | None = None) -> LazySet[_T]: ...
|
||||
|
||||
Reference in New Issue
Block a user