Mark some types as non-hashable (#3219)

Based on @JelleZijlstra's PR #2221.

Fixes #2148
This commit is contained in:
Sebastian Rittau
2019-09-04 17:38:09 +02:00
committed by GitHub
parent 1d21315773
commit efb4af0108
3 changed files with 22 additions and 16 deletions

View File

@@ -11,8 +11,8 @@ def is_immutable(self): ...
def iter_multi_items(mapping): ...
def native_itermethods(names): ...
class ImmutableListMixin:
def __hash__(self): ...
class ImmutableListMixin(object):
def __hash__(self) -> int: ...
def __reduce_ex__(self, protocol): ...
def __delitem__(self, key): ...
def __delslice__(self, i, j): ...
@@ -28,13 +28,13 @@ class ImmutableListMixin:
def reverse(self): ...
def sort(self, cmp: Optional[Any] = ..., key: Optional[Any] = ..., reverse: Optional[Any] = ...): ...
class ImmutableList(ImmutableListMixin, list): ...
class ImmutableList(ImmutableListMixin, list): ... # type: ignore
class ImmutableDictMixin:
class ImmutableDictMixin(object):
@classmethod
def fromkeys(cls, *args, **kwargs): ...
def __reduce_ex__(self, protocol): ...
def __hash__(self): ...
def __hash__(self) -> int: ...
def setdefault(self, key, default: Optional[Any] = ...): ...
def update(self, *args, **kwargs): ...
def pop(self, key, default: Optional[Any] = ...): ...
@@ -71,7 +71,7 @@ class TypeConversionDict(Dict[_K, _V]):
@overload
def get(self, key: _K, default: _D, type: Callable[[_V], _R]) -> Union[_R, _D]: ...
class ImmutableTypeConversionDict(ImmutableDictMixin, TypeConversionDict[_K, _V]):
class ImmutableTypeConversionDict(ImmutableDictMixin, TypeConversionDict[_K, _V]): # type: ignore
def copy(self) -> TypeConversionDict[_K, _V]: ...
def __copy__(self) -> ImmutableTypeConversionDict[_K, _V]: ...
@@ -207,7 +207,7 @@ class EnvironHeaders(ImmutableHeadersMixin, Headers):
def __iter__(self): ...
def copy(self): ...
class CombinedMultiDict(ImmutableMultiDictMixin, MultiDict):
class CombinedMultiDict(ImmutableMultiDictMixin, MultiDict): # type: ignore
def __reduce_ex__(self, protocol): ...
dicts: Any
def __init__(self, dicts: Optional[Any] = ...): ...
@@ -231,15 +231,15 @@ class CombinedMultiDict(ImmutableMultiDictMixin, MultiDict):
class FileMultiDict(MultiDict):
def add_file(self, name, file, filename: Optional[Any] = ..., content_type: Optional[Any] = ...): ...
class ImmutableDict(ImmutableDictMixin, dict):
class ImmutableDict(ImmutableDictMixin, dict): # type: ignore
def copy(self): ...
def __copy__(self): ...
class ImmutableMultiDict(ImmutableMultiDictMixin, MultiDict):
class ImmutableMultiDict(ImmutableMultiDictMixin, MultiDict): # type: ignore
def copy(self): ...
def __copy__(self): ...
class ImmutableOrderedMultiDict(ImmutableMultiDictMixin, OrderedMultiDict):
class ImmutableOrderedMultiDict(ImmutableMultiDictMixin, OrderedMultiDict): # type: ignore
def copy(self): ...
def __copy__(self): ...
@@ -280,7 +280,7 @@ class _CacheControl(UpdateDictMixin, dict):
def __init__(self, values=..., on_update: Optional[Any] = ...): ...
def to_header(self): ...
class RequestCacheControl(ImmutableDictMixin, _CacheControl):
class RequestCacheControl(ImmutableDictMixin, _CacheControl): # type: ignore
max_stale: Any
min_fresh: Any
no_transform: Any
@@ -360,7 +360,7 @@ class ContentRange:
def __nonzero__(self): ...
__bool__: Any
class Authorization(ImmutableDictMixin, Dict[str, Any]):
class Authorization(ImmutableDictMixin, Dict[str, Any]): # type: ignore
type: str
def __init__(self, auth_type: str, data: Optional[Mapping[str, Any]] = ...) -> None: ...
@property