Skip to content

Commit

Permalink
chore: Inline OptionalInt
Browse files Browse the repository at this point in the history
  • Loading branch information
copalco committed Aug 12, 2023
1 parent 07b5b38 commit 54b427a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions falcon/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

Result = TypeVar('Result', bound=Union[bytes, List[bytes]])

OptionalInt = Optional[int]


class BoundedStream(io.IOBase):
"""Wrap *wsgi.input* streams to make them more robust.
Expand Down Expand Up @@ -67,7 +65,7 @@ def __next__(self) -> bytes:

next = __next__

def _read(self, size: OptionalInt, target: Callable[[int], Result]) -> Result:
def _read(self, size: Optional[int], target: Callable[[int], Result]) -> Result:
"""Proxy reads to the underlying stream.
Args:
Expand Down Expand Up @@ -105,7 +103,7 @@ def writable(self) -> bool:
"""Return ``False`` always."""
return False

def read(self, size: OptionalInt = None) -> bytes:
def read(self, size: Optional[int] = None) -> bytes:
"""Read from the stream.
Args:
Expand All @@ -119,7 +117,7 @@ def read(self, size: OptionalInt = None) -> bytes:

return self._read(size, self.stream.read)

def readline(self, limit: OptionalInt = None) -> bytes:
def readline(self, limit: Optional[int] = None) -> bytes:
"""Read a line from the stream.
Args:
Expand All @@ -133,7 +131,7 @@ def readline(self, limit: OptionalInt = None) -> bytes:

return self._read(limit, self.stream.readline)

def readlines(self, hint: OptionalInt = None) -> List[bytes]:
def readlines(self, hint: Optional[int] = None) -> List[bytes]:
"""Read lines from the stream.
Args:
Expand Down

0 comments on commit 54b427a

Please sign in to comment.