Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change __aiter__ return type to AsyncIterator #5165

Merged
merged 1 commit into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ 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 @@ -271,7 +272,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 @@ -583,7 +584,7 @@ def __init__(

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

async def __anext__(
Expand Down