19
19
Any ,
20
20
Dict ,
21
21
Generic ,
22
- Iterable ,
23
22
Iterator ,
24
23
List ,
25
24
NoReturn ,
@@ -107,8 +106,8 @@ def __setstate__(self, state: Tuple[_BodyType, ApiResponseMeta]) -> None:
107
106
def __len__ (self ) -> int :
108
107
return len (self ._body )
109
108
110
- def __iter__ (self ) -> Iterable [Any ]:
111
- return iter (self ._body ) # type: ignore[no-any-return]
109
+ def __iter__ (self ) -> Iterator [Any ]:
110
+ return iter (self ._body )
112
111
113
112
def __str__ (self ) -> str :
114
113
return str (self ._body )
@@ -134,7 +133,7 @@ def raw(self) -> _BodyType:
134
133
class TextApiResponse (ApiResponse [str ]):
135
134
"""API responses which are text such as 'text/plain' or 'text/csv'"""
136
135
137
- def __iter__ (self ) -> Iterable [str ]:
136
+ def __iter__ (self ) -> Iterator [str ]:
138
137
return iter (self .body )
139
138
140
139
def __getitem__ (self , item : Union [int , slice ]) -> str :
@@ -148,7 +147,7 @@ def body(self) -> str:
148
147
class BinaryApiResponse (ApiResponse [bytes ]):
149
148
"""API responses which are a binary response such as Mapbox vector tiles"""
150
149
151
- def __iter__ (self ) -> Iterable [int ]:
150
+ def __iter__ (self ) -> Iterator [int ]:
152
151
return iter (self .body )
153
152
154
153
@overload
@@ -214,7 +213,7 @@ def __getitem__(
214
213
) -> Union [_ListItemBodyType , List [_ListItemBodyType ]]:
215
214
return self .body [item ]
216
215
217
- def __iter__ (self ) -> Iterable [_ListItemBodyType ]:
216
+ def __iter__ (self ) -> Iterator [_ListItemBodyType ]:
218
217
return iter (self .body )
219
218
220
219
@property
0 commit comments