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:
Sebastian Rittau authored and Jelle Zijlstra committed 2017-11-21 17:00:49 -08:00
1 parent 39eefa544c
commit 622e744f3e
2 files changed
+6 -4

No files matched your search

+3 -2
View File
@@ -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]]