Some updates now typing.Container is defined.

This commit is contained in:
Guido van Rossum
2016-01-06 16:38:14 -08:00
parent 9aabb149e3
commit 0f21b59a30
2 changed files with 2 additions and 7 deletions

View File

@@ -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

View File

@@ -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: ...