Skip to content

Commit 5a6c6ab

Browse files
committed
fix some more Anys
1 parent 61d6c67 commit 5a6c6ab

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

stubs/Pygments/pygments/filters/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
from collections.abc import Callable, Generator, Iterable, Iterator
23
from typing import Any
34

@@ -12,7 +13,7 @@ def get_filter_by_name(filtername: str, **options: Any) -> Filter: ...
1213
def get_all_filters() -> Generator[str, None, None]: ...
1314

1415
class CodeTagFilter(Filter):
15-
tag_re: Any
16+
tag_re: re.Pattern[str]
1617
# options are forwarded to Filter's constructor
1718
def __init__(self, **options: Any) -> None: ...
1819
def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ...

stubs/Pygments/pygments/lexers/__init__.pyi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,24 @@ from pygments.lexer import Lexer, LexerMeta
77
def get_all_lexers(plugins: bool = True) -> Iterator[tuple[str, tuple[str, ...], tuple[str, ...], tuple[str, ...]]]: ...
88
def find_lexer_class(name: str) -> LexerMeta | None: ...
99
def find_lexer_class_by_name(_alias: str) -> LexerMeta: ...
10+
11+
# options are forwarded to the lexer's constructor
1012
def get_lexer_by_name(_alias: str, **options: Any) -> Lexer: ...
13+
14+
# options are forwarded to the lexer's constructor
1115
def load_lexer_from_file(filename: FileDescriptorOrPath, lexername: str = "CustomLexer", **options: Any) -> Lexer: ...
1216
def find_lexer_class_for_filename(_fn: StrPath, code: str | bytes | None = None) -> LexerMeta | None: ...
17+
18+
# options are forwarded to the lexer's constructor
1319
def get_lexer_for_filename(_fn: StrPath, code: str | bytes | None = None, **options: Any) -> Lexer: ...
20+
21+
# options are forwarded to the lexer's constructor
1422
def get_lexer_for_mimetype(_mime: str, **options: Any) -> Lexer: ...
23+
24+
# options are forwarded to the lexer's constructor
1525
def guess_lexer_for_filename(_fn: StrPath, _text: str, **options: Any) -> Lexer: ...
26+
27+
# options are forwarded to the lexer's constructor
1628
def guess_lexer(_text: str | bytes, **options: Any) -> Lexer: ...
1729

1830
# Having every lexer class here doesn't seem to be worth it

stubs/Pygments/pygments/unistring.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import Any
2-
31
Cc: str
42
Cf: str
53
Cn: str
@@ -32,7 +30,7 @@ Zp: str
3230
Zs: str
3331
xid_continue: str
3432
xid_start: str
35-
cats: Any
33+
cats: list[str]
3634

3735
def combine(*args: str) -> str: ...
3836
def allexcept(*args: str) -> str: ...

0 commit comments

Comments
 (0)