pygments: Annotate several generator functions (#6695)

This commit is contained in:
Akuli
2021-12-26 14:53:41 +02:00
committed by GitHub
parent f5059c0c41
commit 9efc0c0dca
2 changed files with 14 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
from collections.abc import Iterable, Iterator
from collections.abc import Generator, Iterable, Iterator
from typing import Any
from pygments.filter import Filter
@@ -7,7 +7,7 @@ from pygments.token import _TokenType
def find_filter_class(filtername): ...
def get_filter_by_name(filtername, **options): ...
def get_all_filters(): ...
def get_all_filters() -> Generator[str, None, None]: ...
class CodeTagFilter(Filter):
tag_re: Any

View File

@@ -1,10 +1,17 @@
from typing import Any, Generator, Iterable
from pygments.filter import Filter
from pygments.formatter import Formatter
from pygments.lexer import Lexer
from pygments.style import Style
LEXER_ENTRY_POINT: str
FORMATTER_ENTRY_POINT: str
STYLE_ENTRY_POINT: str
FILTER_ENTRY_POINT: str
def iter_entry_points(group_name): ...
def find_plugin_lexers() -> None: ...
def find_plugin_formatters() -> None: ...
def find_plugin_styles() -> None: ...
def find_plugin_filters() -> None: ...
def iter_entry_points(group_name: str) -> Iterable[Any]: ...
def find_plugin_lexers() -> Generator[type[Lexer], None, None]: ...
def find_plugin_formatters() -> Generator[tuple[str, type[Formatter]], None, None]: ...
def find_plugin_styles() -> Generator[tuple[str, type[Style]], None, None]: ...
def find_plugin_filters() -> Generator[tuple[str, type[Filter]], None, None]: ...