Skip to content
Myr

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

3 files+10 added−7 removed

modified:src/flask/json/__init__.py+1 added-1 removed
3 unmodified lines
4import uuid5import warnings6from datetime import date78from jinja2.utils import htmlsafe_json_dumps as _jinja_htmlsafe_dumps # type: ignore8from jinja2.utils import htmlsafe_json_dumps as _jinja_htmlsafe_dumps9from werkzeug.http import http_date1011from ..globals import current_app12from ..globals import request
338 unmodified lines
modified:src/flask/app.py+1 added-1 removed
702 unmodified lines
703 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 rv709710 def create_global_jinja_loader(self) -> DispatchingJinjaLoader:711 """Creates the loader for the Jinja2 environment. Can be used to
1364 unmodified lines
modified:src/flask/templating.py+8 added-5 removed
49 unmodified lines
5051 def __init__(self, app: "Flask") -> None:52 self.app = app5354 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)6061 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 ] = None6970 for srcobj, loader in self._iter_loaders(template):71 try:72 rv = loader.get_source(environment, template)
12 unmodified lines
85 raise TemplateNotFound(template)8687 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