Enable --disallow-any-generics for stubs (#3288)

This commit is contained in:
Sebastian Rittau
2019-10-01 14:31:34 +02:00
committed by Jelle Zijlstra
parent 23b353303b
commit c32e1e2280
77 changed files with 386 additions and 329 deletions

View File

@@ -2,7 +2,7 @@
from typing import Generic, Dict, List, Mapping, MutableMapping, Optional, TypeVar, Union, Any
_DataType = Union[str, Mapping[str, Union[str, Morsel]]]
_DataType = Union[str, Mapping[str, Union[str, Morsel[Any]]]]
_T = TypeVar('_T')
class CookieError(Exception): ...
@@ -18,7 +18,7 @@ class Morsel(Dict[str, Any], Generic[_T]):
def js_output(self, attrs: Optional[List[str]] = ...) -> str: ...
def OutputString(self, attrs: Optional[List[str]] = ...) -> str: ...
class BaseCookie(Dict[str, Morsel], Generic[_T]):
class BaseCookie(Dict[str, Morsel[_T]], Generic[_T]):
def __init__(self, input: Optional[_DataType] = ...) -> None: ...
def value_decode(self, val: str) -> _T: ...
def value_encode(self, val: _T) -> str: ...
@@ -26,6 +26,6 @@ class BaseCookie(Dict[str, Morsel], Generic[_T]):
sep: str = ...) -> str: ...
def js_output(self, attrs: Optional[List[str]] = ...) -> str: ...
def load(self, rawdata: _DataType) -> None: ...
def __setitem__(self, key: str, value: Union[str, Morsel]) -> None: ...
def __setitem__(self, key: str, value: Union[str, Morsel[_T]]) -> None: ...
class SimpleCookie(BaseCookie): ...
class SimpleCookie(BaseCookie[_T], Generic[_T]): ...