mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-25 05:11:09 +08:00
Add data to UserList class, fix UserDict.data type (#3316)
This commit is contained in:
committed by
Sebastian Rittau
parent
447691cf46
commit
7710e925ca
@@ -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: ...
|
||||
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user