[stdlib] Mark constants as Final (#14577)

This commit is contained in:
Semyon Moroz
2025-08-15 11:19:03 +00:00
committed by GitHub
parent 554701e9b6
commit 85a787bba3
62 changed files with 1601 additions and 1583 deletions
+16 -16
View File
@@ -1,5 +1,5 @@
import sys
from typing import Literal
from typing import Final, Literal
__all__ = [
"cmp_op",
@@ -24,24 +24,24 @@ if sys.version_info >= (3, 13):
__all__ += ["hasjump"]
cmp_op: tuple[Literal["<"], Literal["<="], Literal["=="], Literal["!="], Literal[">"], Literal[">="]]
hasconst: list[int]
hasname: list[int]
hasjrel: list[int]
hasjabs: list[int]
haslocal: list[int]
hascompare: list[int]
hasfree: list[int]
hasconst: Final[list[int]]
hasname: Final[list[int]]
hasjrel: Final[list[int]]
hasjabs: Final[list[int]]
haslocal: Final[list[int]]
hascompare: Final[list[int]]
hasfree: Final[list[int]]
if sys.version_info >= (3, 12):
hasarg: list[int]
hasexc: list[int]
hasarg: Final[list[int]]
hasexc: Final[list[int]]
else:
hasnargs: list[int]
hasnargs: Final[list[int]]
if sys.version_info >= (3, 13):
hasjump: list[int]
opname: list[str]
hasjump: Final[list[int]]
opname: Final[list[str]]
opmap: dict[str, int]
HAVE_ARGUMENT: int
EXTENDED_ARG: int
opmap: Final[dict[str, int]]
HAVE_ARGUMENT: Final = 43
EXTENDED_ARG: Final = 69
def stack_effect(opcode: int, oparg: int | None = None, /, *, jump: bool | None = None) -> int: ...