From 1a8a49e671200afb73bb0e2c833acc84b2e7d753 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Thu, 21 Jul 2022 13:26:44 -0700 Subject: [PATCH] wsgiref.types: use Iterator, not Iterable (#8358) https://github.com/python/typeshed/issues/8356 --- stdlib/_typeshed/wsgi.pyi | 4 ++-- stdlib/wsgiref/types.pyi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/_typeshed/wsgi.pyi b/stdlib/_typeshed/wsgi.pyi index 81ca12910..de731aea9 100644 --- a/stdlib/_typeshed/wsgi.pyi +++ b/stdlib/_typeshed/wsgi.pyi @@ -6,7 +6,7 @@ import sys from _typeshed import OptExcInfo -from collections.abc import Callable, Iterable +from collections.abc import Callable, Iterable, Iterator from typing import Any, Protocol from typing_extensions import TypeAlias @@ -31,7 +31,7 @@ else: 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]: ... # WSGI error streams per PEP 3333, stable class ErrorStream(Protocol): diff --git a/stdlib/wsgiref/types.pyi b/stdlib/wsgiref/types.pyi index b8ece8d57..4e8f47264 100644 --- a/stdlib/wsgiref/types.pyi +++ b/stdlib/wsgiref/types.pyi @@ -1,4 +1,4 @@ -from collections.abc import Callable, Iterable +from collections.abc import Callable, Iterable, Iterator from sys import _OptExcInfo from typing import Any, Protocol from typing_extensions import TypeAlias @@ -17,7 +17,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): def flush(self) -> object: ...