Skip to content

Commit a5d866f

Browse files
committed
Fix __iter__ return type to Iterator
1 parent 09459ef commit a5d866f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

elastic_transport/_response.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def __setstate__(self, state: Tuple[_BodyType, ApiResponseMeta]) -> None:
107107
def __len__(self) -> int:
108108
return len(self._body)
109109

110-
def __iter__(self) -> Iterable[Any]:
110+
def __iter__(self) -> Iterator[Any]:
111111
return iter(self._body) # type: ignore[no-any-return]
112112

113113
def __str__(self) -> str:
@@ -134,7 +134,7 @@ def raw(self) -> _BodyType:
134134
class TextApiResponse(ApiResponse[str]):
135135
"""API responses which are text such as 'text/plain' or 'text/csv'"""
136136

137-
def __iter__(self) -> Iterable[str]:
137+
def __iter__(self) -> Iterator[str]:
138138
return iter(self.body)
139139

140140
def __getitem__(self, item: Union[int, slice]) -> str:
@@ -148,7 +148,7 @@ def body(self) -> str:
148148
class BinaryApiResponse(ApiResponse[bytes]):
149149
"""API responses which are a binary response such as Mapbox vector tiles"""
150150

151-
def __iter__(self) -> Iterable[int]:
151+
def __iter__(self) -> Iterator[int]:
152152
return iter(self.body)
153153

154154
@overload
@@ -214,7 +214,7 @@ def __getitem__(
214214
) -> Union[_ListItemBodyType, List[_ListItemBodyType]]:
215215
return self.body[item]
216216

217-
def __iter__(self) -> Iterable[_ListItemBodyType]:
217+
def __iter__(self) -> Iterator[_ListItemBodyType]:
218218
return iter(self.body)
219219

220220
@property

0 commit comments

Comments
 (0)