From 1c8c6ec7d90e86380d9a732c09213392e3af1fdf Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sun, 29 Jul 2018 07:01:56 +0200 Subject: [PATCH] Add type hints to werkzeug's AcceptMixin (#2349) * Add type hints to werkzeug's AcceptMixin * Fix typo --- third_party/2and3/werkzeug/wrappers.pyi | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/third_party/2and3/werkzeug/wrappers.pyi b/third_party/2and3/werkzeug/wrappers.pyi index 319c0b1eb..183a7a194 100644 --- a/third_party/2and3/werkzeug/wrappers.pyi +++ b/third_party/2and3/werkzeug/wrappers.pyi @@ -8,6 +8,7 @@ from wsgiref.types import WSGIEnvironment, InputStream from .datastructures import ( Authorization, CombinedMultiDict, EnvironHeaders, Headers, ImmutableMultiDict, MultiDict, TypeConversionDict, HeaderSet, + Accept, MIMEAccept, CharsetAccept, LanguageAccept, ) class BaseRequest: @@ -120,11 +121,15 @@ class BaseResponse: def get_wsgi_response(self, environ): ... def __call__(self, environ, start_response): ... -class AcceptMixin: - def accept_mimetypes(self): ... - def accept_charsets(self): ... - def accept_encodings(self): ... - def accept_languages(self): ... +class AcceptMixin(object): + @property + def accept_mimetypes(self) -> MIMEAccept: ... + @property + def accept_charsets(self) -> CharsetAccept: ... + @property + def accept_encodings(self) -> Accept: ... + @property + def accept_languages(self) -> LanguageAccept: ... class ETagRequestMixin: def cache_control(self): ...