8000 gh-95105: Return Iterator from wsgiref.types.InputStream.__iter__ (GH… · python/cpython@deacc3c · GitHub
[go: up one dir, main page]

Skip to content

Commit deacc3c

Browse files
gh-95105: Return Iterator from wsgiref.types.InputStream.__iter__ (GH-95106)
(cherry picked from commit b437894) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
1 parent 120f226 commit deacc3c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/wsgiref/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""WSGI-related types for static type checking"""
22

3-
from collections.abc import Callable, Iterable
3+
from collections.abc import Callable, Iterable, Iterator
44
from types import TracebackType
55
from typing import Any, Protocol, TypeAlias
66

@@ -35,7 +35,7 @@ class InputStream(Protocol):
3535
def read(self, size: int = ..., /) -> bytes: ...
3636
def readline(self, size: int = ..., /) -> bytes: ...
3737
def readlines(self, hint: int = ..., /) -> list[bytes]: ...
38-
def __iter__(self) -> Iterable[bytes]: ...
38+
def __iter__(self) -> Iterator[bytes]: ...
3939

4040
class ErrorStream(Protocol):
4141
"""WSGI error stream as defined in PEP 3333"""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:meth:`wsgiref.types.InputStream.__iter__` should return ``Iterator[bytes]``, not ``Iterable[bytes]``. Patch by Shantanu Jain.

0 commit comments

Comments
 (0)
0