update type annotations
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parent 3a5532b · Browse files · 3 files·+10 added−7 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+10 added−7 removed
- other:+10 added−7 removed
Provenance
- Commit
1403d35- Tree
a746502- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
3a5532b
3 files changed+10 added−7 removed
modified:src/flask/json/__init__.py+1 added-1 removed
3 unmodified lines4 import uuid5 import warnings6 from datetime import date7 8-from jinja2.utils import htmlsafe_json_dumps as _jinja_htmlsafe_dumps # type: ignore8+from jinja2.utils import htmlsafe_json_dumps as _jinja_htmlsafe_dumps9 from werkzeug.http import http_date10 11 from ..globals import current_app12 from ..globals import request338 unmodified linesmodified:src/flask/app.py+1 added-1 removed
702 unmodified lines703 request=request,704 session=session,705 g=g,706 )707- rv.policies["json.dumps_function"] = json.dumps # type: ignore707+ rv.policies["json.dumps_function"] = json.dumps708 return rv709 710 def create_global_jinja_loader(self) -> DispatchingJinjaLoader:711 """Creates the loader for the Jinja2 environment. Can be used to1364 unmodified linesmodified:src/flask/templating.py+8 added-5 removed
49 unmodified lines50 51 def __init__(self, app: "Flask") -> None:52 self.app = app53 54- def get_source(54+ def get_source( # type: ignore55 self, environment: Environment, template: str56- ) -> t.Tuple[str, t.Optional[str], t.Callable]:56+ ) -> t.Tuple[str, t.Optional[str], t.Optional[t.Callable]]:57 if self.app.config["EXPLAIN_TEMPLATE_LOADING"]:58 return self._get_source_explained(environment, template)59 return self._get_source_fast(environment, template)60 61 def _get_source_explained(62 self, environment: Environment, template: str63- ) -> t.Tuple[str, t.Optional[str], t.Callable]:63+ ) -> t.Tuple[str, t.Optional[str], t.Optional[t.Callable]]:64 attempts = []65+ rv: t.Optional[t.Tuple[str, t.Optional[str], t.Optional[t.Callable[[], bool]]]]66+ trv: t.Optional[67+ t.Tuple[str, t.Optional[str], t.Optional[t.Callable[[], bool]]]65- trv = None68+ ] = None69 70 for srcobj, loader in self._iter_loaders(template):71 try:72 rv = loader.get_source(environment, template)12 unmodified lines85 raise TemplateNotFound(template)86 87 def _get_source_fast(88 self, environment: Environment, template: str86- ) -> t.Tuple[str, t.Optional[str], t.Callable]:89+ ) -> t.Tuple[str, t.Optional[str], t.Optional[t.Callable]]:90 for _srcobj, loader in self._iter_loaders(template):91 try:92 return loader.get_source(environment, template)93 except TemplateNotFound:72 unmodified lines