Skip to content

Commit

Permalink
Applied suggestion: Type annotation on class attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyscientist committed Feb 7, 2024
1 parent d78d318 commit c3cdaed
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/urllib3/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,12 @@ class IncompleteRead(HTTPError, httplib_IncompleteRead):
for ``partial`` to avoid creating large objects on streamed reads.
"""

partial: int # type: ignore[assignment]
expected: int

def __init__(self, partial: int, expected: int) -> None:
self.partial: int = partial # type: ignore[assignment]
self.expected: int = expected
self.partial = partial
self.expected = expected

def __repr__(self) -> str:
return "IncompleteRead(%i bytes read, %i more expected)" % (
Expand Down

0 comments on commit c3cdaed

Please sign in to comment.