mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 21:46:43 +08:00
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:
@@ -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.engine import Engine
|
||||
@@ -8,5 +8,5 @@ class Loader:
|
||||
get_template_cache: Dict[str, Any] = ...
|
||||
def __init__(self, engine: Engine) -> None: ...
|
||||
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: ...
|
||||
|
||||
Reference in New Issue
Block a user