From 69d4b1a86dc359d38a0c5ff6fed4e0dd9885abd9 Mon Sep 17 00:00:00 2001 From: Chris Beaven Date: Thu, 9 Dec 2021 21:26:26 +1300 Subject: [PATCH] More accurate template.Parser parse_until type (#769) --- django-stubs/template/base.pyi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/django-stubs/template/base.pyi b/django-stubs/template/base.pyi index 5e3a2e4..3a3be42 100644 --- a/django-stubs/template/base.pyi +++ b/django-stubs/template/base.pyi @@ -1,5 +1,5 @@ from enum import Enum -from typing import Any, Callable, Dict, Iterator, List, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import Any, Callable, Dict, Iterable, Iterator, List, Mapping, Optional, Sequence, Tuple, Type, Union from django.http.request import HttpRequest from django.template.context import Context as Context @@ -109,12 +109,12 @@ class Parser: builtins: Optional[List[Library]] = ..., origin: Optional[Origin] = ..., ) -> None: ... - def parse(self, parse_until: Optional[Tuple[str, ...]] = ...) -> NodeList: ... + def parse(self, parse_until: Optional[Iterable[str]] = ...) -> NodeList: ... def skip_past(self, endtag: str) -> None: ... def extend_nodelist(self, nodelist: NodeList, node: Node, token: Token) -> None: ... def error(self, token: Token, e: Union[Exception, str]) -> Exception: ... - def invalid_block_tag(self, token: Token, command: str, parse_until: Union[List[Any], Tuple[str]] = ...) -> Any: ... - def unclosed_block_tag(self, parse_until: Tuple[str]) -> Any: ... + def invalid_block_tag(self, token: Token, command: str, parse_until: Optional[Iterable[str]] = ...) -> Any: ... + def unclosed_block_tag(self, parse_until: Iterable[str]) -> Any: ... def next_token(self) -> Token: ... def prepend_token(self, token: Token) -> None: ... def delete_first_token(self) -> None: ...