Skip to content

Commit 36311a8

Browse files
asottileasottile-sentry
authored andcommitted
fix stubs of HttpRequest read / readine
these both accept None which consumes the whole stream
1 parent 4dc5d9a commit 36311a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

django-stubs/http/request.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ class HttpRequest:
105105
def accepts(self, media_type: str) -> bool: ...
106106
def close(self) -> None: ...
107107
# File-like and iterator interface, a minimal subset of BytesIO.
108-
def read(self, n: int = -1, /) -> bytes: ...
109-
def readline(self, limit: int = -1, /) -> bytes: ...
108+
def read(self, n: int | None = -1, /) -> bytes: ...
109+
def readline(self, limit: int | None = -1, /) -> bytes: ...
110110
def __iter__(self) -> Iterator[bytes]: ...
111111
def readlines(self) -> list[bytes]: ...
112112

0 commit comments

Comments
 (0)