mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 20:31:32 +08:00
Enable --disallow-any-generics for stubs (#3288)
This commit is contained in:
committed by
Jelle Zijlstra
parent
23b353303b
commit
c32e1e2280
@@ -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]): ...
|
||||
|
||||
Reference in New Issue
Block a user