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

add missing type hints for ItemPaged #24548

Merged
merged 2 commits into from
May 23, 2022
Merged
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions sdk/core/azure-core/azure/core/paging.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ def __init__(self, *args, **kwargs):
"page_iterator_class", PageIterator
)

def by_page(self, continuation_token=None):
# type: (Optional[str]) -> Iterator[Iterator[ReturnType]]
def by_page(self, continuation_token: Optional[str] = None) -> Iterator[Iterator[ReturnType]]:
"""Get an iterator of pages of objects, instead of an iterator of objects.

:param str continuation_token:
Expand All @@ -123,7 +122,7 @@ def __iter__(self):
"""Return 'self'."""
return self

def __next__(self):
def __next__(self) -> ReturnType:
if self._page_iterator is None:
self._page_iterator = itertools.chain.from_iterable(self.by_page())
return next(self._page_iterator)
Expand Down