Skip to content

models.pyi: Add missing requests.Respons.next()#3328

Merged
srittau merged 3 commits intopython:masterfrom
utkarsh2102:next
Oct 9, 2019
Merged

models.pyi: Add missing requests.Respons.next()#3328
srittau merged 3 commits intopython:masterfrom
utkarsh2102:next

Conversation

@utkarsh2102
Copy link
Contributor

Closes: #3207

def __enter__(self) -> Response: ...
def __exit__(self, *args: Any) -> None: ...
def next(self) -> PreparedRequest: ...
def next(self) -> None: ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be Union[None, PreparedRequest] to express it can be either. A nicer way to write unions with None is to useOptional, though: Optional [PreparedRequest].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah!
TIL: Optional[...] is a shorthand notation for Union[..., None]. Thanks!

@srittau srittau merged commit bd7222c into python:master Oct 9, 2019
@utkarsh2102 utkarsh2102 deleted the next branch October 9, 2019 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

requests.Response is missing .next

2 participants