|
1 | 1 | from _typeshed import SupportsWrite |
2 | 2 | from collections.abc import Iterator |
3 | | -from typing import TypeVar, overload |
| 3 | +from typing import Final, TypeVar, overload |
4 | 4 |
|
5 | 5 | from pygments.formatter import Formatter |
6 | 6 | from pygments.lexer import Lexer |
7 | 7 | from pygments.token import _TokenType |
8 | 8 |
|
9 | 9 | _T = TypeVar("_T", str, bytes) |
10 | 10 |
|
11 | | -__version__: str |
| 11 | +__version__: Final[str] |
| 12 | +__docformat__: Final = "restructuredtext" |
12 | 13 | __all__ = ["lex", "format", "highlight"] |
13 | 14 |
|
14 | 15 | def lex(code: str, lexer: Lexer) -> Iterator[tuple[_TokenType, str]]: ... |
15 | 16 | @overload |
16 | | -def format(tokens, formatter: Formatter[_T], outfile: SupportsWrite[_T]) -> None: ... |
| 17 | +def format(tokens: Iterator[tuple[_TokenType, str]], formatter: Formatter[_T], outfile: SupportsWrite[_T]) -> None: ... |
17 | 18 | @overload |
18 | | -def format(tokens, formatter: Formatter[_T], outfile: None = None) -> _T: ... |
| 19 | +def format(tokens: Iterator[tuple[_TokenType, str]], formatter: Formatter[_T], outfile: None = None) -> _T: ... |
19 | 20 | @overload |
20 | | -def highlight(code, lexer, formatter: Formatter[_T], outfile: SupportsWrite[_T]) -> None: ... |
| 21 | +def highlight(code: str, lexer: Lexer, formatter: Formatter[_T], outfile: SupportsWrite[_T]) -> None: ... |
21 | 22 | @overload |
22 | | -def highlight(code, lexer, formatter: Formatter[_T], outfile: None = None) -> _T: ... |
| 23 | +def highlight(code: str, lexer: Lexer, formatter: Formatter[_T], outfile: None = None) -> _T: ... |
0 commit comments