mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 20:01:29 +08:00
apply black and isort (#4287)
* apply black and isort * move some type ignores
This commit is contained in:
@@ -1,27 +1,41 @@
|
||||
import sys
|
||||
import types
|
||||
from _weakrefset import WeakSet as WeakSet
|
||||
from typing import (
|
||||
TypeVar, Generic, Any, Callable, overload, Mapping, Iterator, Tuple,
|
||||
Iterable, Optional, Type, MutableMapping, Union, List, Dict
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
Generic,
|
||||
Iterable,
|
||||
Iterator,
|
||||
List,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
Optional,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
|
||||
from _weakref import (
|
||||
getweakrefcount as getweakrefcount,
|
||||
getweakrefs as getweakrefs,
|
||||
ref as ref,
|
||||
proxy as proxy,
|
||||
CallableProxyType as CallableProxyType,
|
||||
ProxyType as ProxyType,
|
||||
ReferenceType as ReferenceType)
|
||||
from _weakrefset import WeakSet as WeakSet
|
||||
ReferenceType as ReferenceType,
|
||||
getweakrefcount as getweakrefcount,
|
||||
getweakrefs as getweakrefs,
|
||||
proxy as proxy,
|
||||
ref as ref,
|
||||
)
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
from exceptions import ReferenceError as ReferenceError
|
||||
|
||||
_S = TypeVar('_S')
|
||||
_T = TypeVar('_T')
|
||||
_KT = TypeVar('_KT')
|
||||
_VT = TypeVar('_VT')
|
||||
_S = TypeVar("_S")
|
||||
_T = TypeVar("_T")
|
||||
_KT = TypeVar("_KT")
|
||||
_VT = TypeVar("_VT")
|
||||
|
||||
ProxyTypes: Tuple[Type[Any], ...]
|
||||
|
||||
@@ -35,7 +49,6 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, __map: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, k: _KT) -> _VT: ...
|
||||
def __setitem__(self, k: _KT, v: _VT) -> None: ...
|
||||
@@ -45,9 +58,7 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
def copy(self) -> WeakValueDictionary[_KT, _VT]: ...
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
def keys(self) -> List[_KT]: ...
|
||||
def values(self) -> List[_VT]: ...
|
||||
@@ -72,7 +83,6 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, __map: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, k: _KT) -> _VT: ...
|
||||
def __setitem__(self, k: _KT, v: _VT) -> None: ...
|
||||
@@ -82,9 +92,7 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
def copy(self) -> WeakKeyDictionary[_KT, _VT]: ...
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
def keys(self) -> List[_KT]: ...
|
||||
def values(self) -> List[_VT]: ...
|
||||
|
||||
Reference in New Issue
Block a user