Skip to content
Merged
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
pylint / mypy / black
  • Loading branch information
lmazuel committed Jul 24, 2019
commit 3380df9a9be2207e57c4ca99df2680f856db278e
2 changes: 1 addition & 1 deletion sdk/core/azure-core/azure/core/async_paging.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async def __anext__(self) -> ReturnType:
class AsyncPageIterator(AsyncIterator[AsyncIterator[ReturnType]]):
def __init__(
self,
get_next: Callable[[str], Awaitable[ResponseType]],
get_next: Callable[[Optional[str]], Awaitable[ResponseType]],
extract_data: Callable[
[ResponseType], Awaitable[Tuple[str, AsyncIterator[ReturnType]]]
],
Expand Down
16 changes: 8 additions & 8 deletions sdk/core/azure-core/azure/core/paging.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,12 @@
# --------------------------------------------------------------------------
import itertools
from typing import (
Dict,
Any,
List,
Callable,
Optional,
TypeVar,
Iterator,
Iterable,
Tuple,
Type,
) # pylint: disable=unused-import
import logging

Expand All @@ -46,8 +42,12 @@


class PageIterator(Iterator[Iterator[ReturnType]]):
def __init__(self, get_next, extract_data, continuation_token=None):
# type: (Callable[[str], ResponseType], Callable[[ResponseType], Tuple[str, Iterable[ReturnType]]], Optional[str]) -> None
def __init__(
self,
get_next, # type: Callable[[Optional[str]], ResponseType]
extract_data, # type: Callable[[ResponseType], Tuple[str, Iterable[ReturnType]]]
continuation_token=None, # type: Optional[str]
):
"""Return an iterator of pages.

:param get_next: Callable that take the continuation token and return a HTTP response
Expand All @@ -59,8 +59,8 @@ def __init__(self, get_next, extract_data, continuation_token=None):
self._extract_data = extract_data
self.continuation_token = continuation_token
self._did_a_call_already = False
self._response = None
self._current_page = None
self._response = None # type: Optional[ResponseType]
self._current_page = None # type: Optional[Iterable[ReturnType]]

def __iter__(self):
"""Return 'self'."""
Expand Down