Miscellaneous type_check_only annotations (#13058)

This commit is contained in:
Stephen Morton
2024-11-21 00:41:38 -08:00
committed by GitHub
parent ae7f6ea59c
commit 0fb3a092c7
4 changed files with 12 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ from collections.abc import Callable, Generator, Iterable, Sequence
from re import Pattern
from token import *
from token import EXACT_TOKEN_TYPES as EXACT_TOKEN_TYPES
from typing import Any, NamedTuple, TextIO
from typing import Any, NamedTuple, TextIO, type_check_only
from typing_extensions import TypeAlias
__all__ = [
@@ -98,6 +98,8 @@ blank_re: Pattern[bytes]
_Position: TypeAlias = tuple[int, int]
# This class is not exposed. It calls itself tokenize.TokenInfo.
@type_check_only
class _TokenInfo(NamedTuple):
type: int
string: str