Skip to content

Commit d58324d

Browse files
Fix types
1 parent cadddad commit d58324d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Lib/_colorize.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,12 @@ class _Span(NamedTuple):
399399
end: int
400400

401401
@classmethod
402-
def from_re(cls, m: Match[str], group: int | str):
402+
def from_re(cls, m: Match[str], group: int | str) -> "_Span":
403403
re_span = m.span(group)
404404
return cls(re_span[0], re_span[1] - 1)
405405

406406
@classmethod
407-
def from_token(cls, token: TI, line_len: list[int]):
407+
def from_token(cls, token: TI, line_len: list[int]) -> "_Span":
408408
end_offset = -1
409409
if (token.type in {T.FSTRING_MIDDLE, T.TSTRING_MIDDLE}
410410
and token.string.endswith(("{", "}"))):
@@ -418,7 +418,7 @@ def from_token(cls, token: TI, line_len: list[int]):
418418

419419

420420
class _ColorSpan(NamedTuple):
421-
span: Span
421+
span: _Span
422422
tag: str
423423

424424

Lib/_pyrepl/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# Re-export from _colorize for backward compatibility
1717
gen_colors = _colorize._gen_colors
18-
ColorSpam = _colorize._ColorSpan
18+
ColorSpan = _colorize._ColorSpan
1919
Span = _colorize._Span
2020

2121

0 commit comments

Comments
 (0)