Add data to UserList class, fix UserDict.data type (#3316)

This commit is contained in:
Rune Tynan
2019-10-07 11:05:19 -04:00
committed by Sebastian Rittau
parent 447691cf46
commit 7710e925ca
2 changed files with 3 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ _VT = TypeVar('_VT')
_T = TypeVar('_T')
class UserDict(Dict[_KT, _VT], Generic[_KT, _VT]):
data: Mapping[_KT, _VT]
data: Dict[_KT, _VT]
def __init__(self, initialdata: Mapping[_KT, _VT] = ...) -> None: ...

View File

@@ -1,9 +1,10 @@
from typing import Iterable, MutableSequence, TypeVar, Union, overload
from typing import Iterable, MutableSequence, TypeVar, Union, overload, List
_T = TypeVar("_T")
_S = TypeVar("_S")
class UserList(MutableSequence[_T]):
data: List[_T]
def insert(self, index: int, object: _T) -> None: ...
@overload
def __setitem__(self, i: int, o: _T) -> None: ...