mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-08 20:43:25 +08:00
apply black and isort (#4287)
* apply black and isort * move some type ignores
This commit is contained in:
@@ -1,25 +1,35 @@
|
||||
from typing import (Any, Container, Dict, Generic, Iterable, Iterator, List,
|
||||
Mapping, Optional, Sized, Tuple, TypeVar, Union, overload)
|
||||
from typing import (
|
||||
Any,
|
||||
Container,
|
||||
Dict,
|
||||
Generic,
|
||||
Iterable,
|
||||
Iterator,
|
||||
List,
|
||||
Mapping,
|
||||
Optional,
|
||||
Sized,
|
||||
Tuple,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
|
||||
_KT = TypeVar('_KT')
|
||||
_VT = TypeVar('_VT')
|
||||
_T = TypeVar('_T')
|
||||
_KT = TypeVar("_KT")
|
||||
_VT = TypeVar("_VT")
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class UserDict(Dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
data: Dict[_KT, _VT]
|
||||
|
||||
def __init__(self, initialdata: Mapping[_KT, _VT] = ...) -> None: ...
|
||||
|
||||
# TODO: __iter__ is not available for UserDict
|
||||
|
||||
class IterableUserDict(UserDict[_KT, _VT], Generic[_KT, _VT]):
|
||||
...
|
||||
class IterableUserDict(UserDict[_KT, _VT], Generic[_KT, _VT]): ...
|
||||
|
||||
class DictMixin(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT]):
|
||||
def has_key(self, key: _KT) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
|
||||
# From typing.Mapping[_KT, _VT]
|
||||
# (can't inherit because of keys())
|
||||
@overload
|
||||
@@ -32,7 +42,6 @@ class DictMixin(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT]):
|
||||
def itervalues(self) -> Iterator[_VT]: ...
|
||||
def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ...
|
||||
def __contains__(self, o: Any) -> bool: ...
|
||||
|
||||
# From typing.MutableMapping[_KT, _VT]
|
||||
def clear(self) -> None: ...
|
||||
def pop(self, k: _KT, default: _VT = ...) -> _VT: ...
|
||||
|
||||
Reference in New Issue
Block a user