Skip to content

Commit

Permalink
Change __aiter__ return type to AsyncIterator (aio-libs#5165)
Browse files Browse the repository at this point in the history
  • Loading branch information
blazewicz authored and asvetlov committed Oct 28, 2020
1 parent d9bc0a5 commit 28041e4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/5163.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change return type of MultipartReader.__aiter__() and BodyPartReader.__aiter__() to AsyncIterator.
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ Kevin Samuel
Kimmo Parviainen-Jalanko
Kirill Klenov
Kirill Malovitsa
Konstantin Valetov
Krzysztof Blazewicz
Kyrylo Perevozchikov
Kyungmin Lee
Lars P. Søndergaard
Expand Down
5 changes: 3 additions & 2 deletions aiohttp/multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import (
TYPE_CHECKING,
Any,
AsyncIterator,
Dict,
Iterator,
List,
Expand Down Expand Up @@ -265,7 +266,7 @@ def __init__(
self._content_eof = 0
self._cache = {} # type: Dict[str, Any]

def __aiter__(self) -> Iterator["BodyPartReader"]:
def __aiter__(self) -> AsyncIterator["BodyPartReader"]:
return self # type: ignore

async def __anext__(self) -> bytes:
Expand Down Expand Up @@ -539,7 +540,7 @@ def __init__(self, headers: Mapping[str, str], content: StreamReader) -> None:

def __aiter__(
self,
) -> Iterator["BodyPartReader"]:
) -> AsyncIterator["BodyPartReader"]:
return self # type: ignore

async def __anext__(
Expand Down

0 comments on commit 28041e4

Please sign in to comment.