Skip to content

Commit 4168a35

Browse files
Small typing fixes.
1 parent d8adbe9 commit 4168a35

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/prompt_toolkit/formatted_text/base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, Callable, Iterable, List, Tuple, Union, cast
3+
from typing import TYPE_CHECKING, Callable, Iterable, List, Tuple, Union, cast
44

55
from prompt_toolkit.mouse_events import MouseEvent
66

@@ -45,8 +45,7 @@ def __pt_formatted_text__(self) -> StyleAndTextTuples: ...
4545
str,
4646
"MagicFormattedText",
4747
StyleAndTextTuples,
48-
# Callable[[], 'AnyFormattedText'] # Recursive definition not supported by mypy.
49-
Callable[[], Any],
48+
Callable[[], "AnyFormattedText"],
5049
None,
5150
]
5251

src/prompt_toolkit/lexers/pygments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def get_sync_start_position(
104104
return lineno, 0
105105

106106
@classmethod
107-
def from_pygments_lexer_cls(cls, lexer_cls: PygmentsLexerCls) -> RegexSync:
107+
def from_pygments_lexer_cls(cls, lexer_cls: type[PygmentsLexerCls]) -> RegexSync:
108108
"""
109109
Create a :class:`.RegexSync` instance for this Pygments lexer class.
110110
"""

0 commit comments

Comments
 (0)