More accurate template.Parser parse_until type (#769)

This commit is contained in:
Chris Beaven
2021-12-09 21:26:26 +13:00
committed by GitHub
parent 6436a10d5a
commit 69d4b1a86d

View File

@@ -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: ...