Template Loader.get_template_sources yield Origins (#476)

django.template.loaders.base.Loader.get_template_sources should yield Origins:
https://docs.djangoproject.com/en/3.1/ref/templates/api/#django.template.loaders.base.Loader.get_template_sources

Currently it's returning none. Objects that yield should be marked as iterables.
https://mypy.readthedocs.io/en/stable/kinds_of_types.html#generators
This commit is contained in:
William Schwartz
2020-09-29 17:21:38 -05:00
committed by GitHub
parent 534a028ea2
commit 5bc3759ea2

View File

@@ -1,4 +1,4 @@
from typing import Any, List, Optional, Dict from typing import Any, List, Iterable, Optional, Dict
from django.template.base import Origin, Template from django.template.base import Origin, Template
from django.template.engine import Engine from django.template.engine import Engine
@@ -8,5 +8,5 @@ class Loader:
get_template_cache: Dict[str, Any] = ... get_template_cache: Dict[str, Any] = ...
def __init__(self, engine: Engine) -> None: ... def __init__(self, engine: Engine) -> None: ...
def get_template(self, template_name: str, skip: Optional[List[Origin]] = ...) -> Template: ... def get_template(self, template_name: str, skip: Optional[List[Origin]] = ...) -> Template: ...
def get_template_sources(self, template_name: str) -> None: ... def get_template_sources(self, template_name: str) -> Iterable[Origin]: ...
def reset(self) -> None: ... def reset(self) -> None: ...