Skip to content

Commit 07583e7

Browse files
Merge pull request #131 from Neradoc/add-response-properties-doc
Add docstrings for response.status_code and reason
2 parents 6dd6dee + e573362 commit 07583e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

adafruit_requests.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,10 @@ def __init__(self, sock: SocketType, session: Optional["Session"] = None) -> Non
195195
else:
196196
self.socket.close()
197197
raise RuntimeError("Unable to read HTTP response.")
198-
self.status_code = int(bytes(self._readto(b" ")))
199-
self.reason = self._readto(b"\r\n")
198+
self.status_code: int = int(bytes(self._readto(b" ")))
199+
"""The status code returned by the server"""
200+
self.reason: bytearray = self._readto(b"\r\n")
201+
"""The status reason returned by the server"""
200202
self._parse_headers()
201203
self._raw = None
202204
self._session = session

0 commit comments

Comments
 (0)