mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Some updates now typing.Container is defined.
This commit is contained in:
@@ -44,8 +44,6 @@ _V_co = TypeVar('_V_co', covariant=True) # Any type covariant containers.
|
||||
_VT_co = TypeVar('_VT_co', covariant=True) # Value type covariant containers.
|
||||
_T_contra = TypeVar('_T_contra', contravariant=True) # Ditto contravariant.
|
||||
|
||||
# TODO Container etc.
|
||||
|
||||
class SupportsInt(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def __int__(self) -> int: ...
|
||||
@@ -115,7 +113,7 @@ class MutableSequence(Sequence[_T], Generic[_T]):
|
||||
def remove(self, object: _T) -> None: ...
|
||||
def __iadd__(self, x: Iterable[_T]) -> MutableSequence[_T]: ...
|
||||
|
||||
class AbstractSet(Sized, Iterable[_T_co], Generic[_T_co]):
|
||||
class AbstractSet(Sized, Iterable[_T_co], Container[_T_co], Generic[_T_co]):
|
||||
@abstractmethod
|
||||
def __contains__(self, x: object) -> bool: ...
|
||||
# Mixin methods
|
||||
@@ -144,7 +142,7 @@ class MutableSet(AbstractSet[_T], Generic[_T]):
|
||||
def __ixor__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ...
|
||||
def __isub__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ...
|
||||
|
||||
class Mapping(Sized, Iterable[_KT], Generic[_KT, _VT]):
|
||||
class Mapping(Sized, Iterable[_KT], Container[_KT], Generic[_KT, _VT]):
|
||||
@abstractmethod
|
||||
def __getitem__(self, k: _KT) -> _VT: ...
|
||||
# Mixin methods
|
||||
@@ -155,7 +153,6 @@ class Mapping(Sized, Iterable[_KT], Generic[_KT, _VT]):
|
||||
def iterkeys(self) -> Iterator[_KT]: ...
|
||||
def itervalues(self) -> Iterator[_VT]: ...
|
||||
def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
|
||||
class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
@abstractmethod
|
||||
|
||||
@@ -46,8 +46,6 @@ _KT_co = TypeVar('_KT_co', covariant=True) # Key type covariant containers.
|
||||
_VT_co = TypeVar('_VT_co', covariant=True) # Value type covariant containers.
|
||||
_T_contra = TypeVar('_T_contra', contravariant=True) # Ditto contravariant.
|
||||
|
||||
# TODO Container etc.
|
||||
|
||||
class SupportsInt(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def __int__(self) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user