Skip to content

Commit

Permalink
Document that requests.session() is depreciated
Browse files Browse the repository at this point in the history
Adds a docstring note that `requests.session()` is depreciated. Users should
use `requests.Session()` in versions released after Requests v1.0.
  • Loading branch information
Stevoisiak committed Jun 21, 2018
1 parent 883caaf commit 1c13c5e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion requests/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,12 @@ def session():
"""
Returns a :class:`Session` for context-management.
.. deprecated:: 1.0.0
This method has been deprecated since version 1.0.0 and is only kept for
backwards compatibility. New code should use :class:`~requests.sessions.Session`
to create a session. This may be removed at a future date.
:rtype: Session
"""

return Session()

0 comments on commit 1c13c5e

Please sign in to comment.