Mark stdlib token constants as Final (#14324)

This commit is contained in:
Brian Schubert
2025-06-22 09:44:34 -04:00
committed by GitHub
parent d0f9f40e32
commit 85b0663e5c
2 changed files with 82 additions and 76 deletions
+6 -1
View File
@@ -3,10 +3,15 @@ from _typeshed import FileDescriptorOrPath
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, type_check_only
from typing_extensions import TypeAlias
if sys.version_info < (3, 12):
# Avoid double assignment to Final name by imports, which pyright objects to.
# EXACT_TOKEN_TYPES is already defined by 'from token import *' above
# in Python 3.12+.
from token import EXACT_TOKEN_TYPES as EXACT_TOKEN_TYPES
__all__ = [
"AMPER",
"AMPEREQUAL",