Skip to content
Snippets Groups Projects
Unverified Commit deacc3c9 authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by GitHub
Browse files

gh-95105: Return Iterator from wsgiref.types.InputStream.__iter__ (GH-95106)


(cherry picked from commit b4378948)

Co-authored-by: default avatarShantanu <12621235+hauntsaninja@users.noreply.github.com>
parent 120f2268
Branches
Tags
No related merge requests found
"""WSGI-related types for static type checking"""
from collections.abc import Callable, Iterable
from collections.abc import Callable, Iterable, Iterator
from types import TracebackType
from typing import Any, Protocol, TypeAlias
......@@ -35,7 +35,7 @@ class InputStream(Protocol):
def read(self, size: int = ..., /) -> bytes: ...
def readline(self, size: int = ..., /) -> bytes: ...
def readlines(self, hint: int = ..., /) -> list[bytes]: ...
def __iter__(self) -> Iterable[bytes]: ...
def __iter__(self) -> Iterator[bytes]: ...
class ErrorStream(Protocol):
"""WSGI error stream as defined in PEP 3333"""
......
:meth:`wsgiref.types.InputStream.__iter__` should return ``Iterator[bytes]``, not ``Iterable[bytes]``. Patch by Shantanu Jain.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment