|
1 | 1 | # Stubs for requests.sessions (Python 3)
|
2 | 2 |
|
3 |
| -from typing import Any, Union, MutableMapping, Text, Optional, IO, Tuple, Callable |
| 3 | +from typing import Any, Union, List, MutableMapping, Text, Optional, IO, Tuple, Callable, Iterable |
4 | 4 | from . import adapters
|
5 | 5 | from . import auth as _auth
|
6 | 6 | from . import compat
|
@@ -56,7 +56,10 @@ class SessionRedirectMixin:
|
56 | 56 | def rebuild_proxies(self, prepared_request, proxies): ...
|
57 | 57 |
|
58 | 58 | _Data = Union[None, bytes, MutableMapping[Text, Text], IO]
|
59 |
| -_Hooks = MutableMapping[Text, Callable[[Response], Any]] |
| 59 | + |
| 60 | +_Hook = Callable[[Response], Any] |
| 61 | +_Hooks = MutableMapping[Text, List[_Hook]] |
| 62 | +_HooksInput = MutableMapping[Text, Union[Iterable[_Hook], _Hook]] |
60 | 63 |
|
61 | 64 | class Session(SessionRedirectMixin):
|
62 | 65 | __attrs__ = ... # type: Any
|
@@ -87,7 +90,7 @@ class Session(SessionRedirectMixin):
|
87 | 90 | timeout: Union[None, float, Tuple[float, float]] = ...,
|
88 | 91 | allow_redirects: Optional[bool] = ...,
|
89 | 92 | proxies: Optional[MutableMapping[Text, Text]] = ...,
|
90 |
| - hooks: Optional[_Hooks] = ..., |
| 93 | + hooks: Optional[_HooksInput] = ..., |
91 | 94 | stream: Optional[bool] = ...,
|
92 | 95 | verify: Union[None, bool, Text] = ...,
|
93 | 96 | cert: Union[Text, Tuple[Text, Text], None] = ...,
|
|
0 commit comments