mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-25 05:11:09 +08:00
Extract WSGIEnvironment and change value type to Any (#1745)
* Extract WSGIEnvironment in wsgiref.types * Change value type of WSGIEnvironment to Any Per PEP 3333, a WSGI environment can contain anything, not just strings.
This commit is contained in:
committed by
Jelle Zijlstra
parent
39eefa544c
commit
622e744f3e
@@ -15,16 +15,17 @@
|
||||
# you need to use 'WSGIApplication' and not simply WSGIApplication when type
|
||||
# hinting your code. Otherwise Python will raise NameErrors.
|
||||
|
||||
from typing import Callable, Dict, Iterable, List, Optional, Tuple, Type, Union
|
||||
from typing import Callable, Dict, Iterable, List, Optional, Tuple, Type, Union, Any
|
||||
from types import TracebackType
|
||||
|
||||
_exc_info = Tuple[Optional[Type[BaseException]],
|
||||
Optional[BaseException],
|
||||
Optional[TracebackType]]
|
||||
_Text = Union[unicode, str]
|
||||
WSGIEnvironment = Dict[_Text, Any]
|
||||
WSGIApplication = Callable[
|
||||
[
|
||||
Dict[_Text, _Text],
|
||||
WSGIEnvironment,
|
||||
Union[
|
||||
Callable[[_Text, List[Tuple[_Text, _Text]]], Callable[[_Text], None]],
|
||||
Callable[[_Text, List[Tuple[_Text, _Text]], _exc_info], Callable[[_Text], None]]
|
||||
|
||||
@@ -15,15 +15,16 @@
|
||||
# you need to use 'WSGIApplication' and not simply WSGIApplication when type
|
||||
# hinting your code. Otherwise Python will raise NameErrors.
|
||||
|
||||
from typing import Callable, Dict, Iterable, List, Optional, Tuple, Type, Union
|
||||
from typing import Callable, Dict, Iterable, List, Optional, Tuple, Type, Union, Any
|
||||
from types import TracebackType
|
||||
|
||||
_exc_info = Tuple[Optional[Type[BaseException]],
|
||||
Optional[BaseException],
|
||||
Optional[TracebackType]]
|
||||
WSGIEnvironment = Dict[str, Any]
|
||||
WSGIApplication = Callable[
|
||||
[
|
||||
Dict[str, str],
|
||||
WSGIEnvironment,
|
||||
Union[
|
||||
Callable[[str, List[Tuple[str, str]]], Callable[[Union[bytes, str]], None]],
|
||||
Callable[[str, List[Tuple[str, str]], _exc_info], Callable[[Union[bytes, str]], None]]
|
||||
|
||||
Reference in New Issue
Block a user