mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 05:22:23 +08:00
Add stubs for UserList, UserString, UserDict.
This commit is contained in:
3
stdlib/2.7/UserList.pyi
Normal file
3
stdlib/2.7/UserList.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
import collections
|
||||
|
||||
class UserList(collections.MutableSequence): ...
|
||||
4
stdlib/2.7/UserString.pyi
Normal file
4
stdlib/2.7/UserString.pyi
Normal file
@@ -0,0 +1,4 @@
|
||||
import collections
|
||||
|
||||
class UserString(collections.Sequence): ...
|
||||
class MutableString(UserString, collections.MutableSequence): ...
|
||||
@@ -2,16 +2,13 @@
|
||||
|
||||
# Based on http://docs.python.org/2.7/library/collections.html
|
||||
|
||||
# TODO UserDict
|
||||
# TODO UserList
|
||||
# TODO UserString
|
||||
# TODO more abstract base classes (interfaces in mypy)
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from typing import (
|
||||
Dict, Generic, TypeVar, Iterable, Tuple, Callable, Mapping, overload, Iterator, Sized,
|
||||
Optional, List, Set, Sequence, Union, Reversible
|
||||
Optional, List, Set, Sequence, Union, Reversible, MutableMapping, MutableSequence
|
||||
)
|
||||
import typing
|
||||
|
||||
@@ -22,8 +19,6 @@ _VT = TypeVar('_VT')
|
||||
# namedtuple is special-cased in the type checker; the initializer is ignored.
|
||||
namedtuple = object()
|
||||
|
||||
MutableMapping = typing.MutableMapping
|
||||
|
||||
class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T] = ...,
|
||||
maxlen: int = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user