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 type hints to HttpResponse #94

Merged
merged 4 commits into from
Mar 9, 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
8 changes: 6 additions & 2 deletions azure/functions/_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ class HttpResponse(_abc.HttpResponse):
``'utf-8'``.
"""

def __init__(self, body=None, *,
status_code=None, headers=None, mimetype=None, charset=None):
def __init__(self,
body: typing.Union[str, bytes] = None, *,
status_code: int = None,
headers: typing.Optional[typing.Mapping[str, str]] = None,
mimetype: typing.Optional[str] = None,
charset: str = None) -> None:
if status_code is None:
status_code = 200
self.__status_code = status_code
Expand Down