Remove unnecessary optionality for requests.Session (#1658)

Current code that initializes the things I've changed, to demonstrate that the
object is initialized this way:

* headers: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L345
* proxies: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L354
* hooks: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L357
* params: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L362
* cookies: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L388

from what I can tell nothing in the official requests API ever creates a
session other than through `__init__`.
This commit is contained in:
Brandon W Maister
2017-11-08 22:53:56 -05:00
committed by Jelle Zijlstra
parent 9439ec4e4f
commit a1238294d7

View File

@@ -64,13 +64,13 @@ class Session(SessionRedirectMixin):
auth = ... # type: Union[None, Tuple[Text, Text], Callable[[Request], Request]]
proxies = ... # type: MutableMapping[Text, Text]
hooks = ... # type: _Hooks
params = ... # type: Union[None, bytes, MutableMapping[Text, Text]]
params = ... # type: Union[bytes, MutableMapping[Text, Text]]
stream = ... # type: bool
verify = ... # type: bool
cert = ... # type: Union[None, Text, Tuple[Text, Text]]
max_redirects = ... # type: int
trust_env = ... # type: bool
cookies = ... # type: Union[None, RequestsCookieJar, MutableMapping[Text, Text]]
cookies = ... # type: Union[RequestsCookieJar, MutableMapping[Text, Text]]
adapters = ... # type: MutableMapping
redirect_cache = ... # type: RecentlyUsedContainer
def __init__(self) -> None: ...