From b47e97f2eaae4a72df56fa78fee413051f516d34 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 18 Jan 2022 13:08:54 +0300 Subject: [PATCH] Add `__all__` to `opcode` and use `Literal` for constants (#6945) --- stdlib/opcode.pyi | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/stdlib/opcode.pyi b/stdlib/opcode.pyi index 69588c369..402dbb74c 100644 --- a/stdlib/opcode.pyi +++ b/stdlib/opcode.pyi @@ -1,6 +1,23 @@ import sys from typing_extensions import Literal +__all__ = [ + "cmp_op", + "hasconst", + "hasname", + "hasjrel", + "hasjabs", + "haslocal", + "hascompare", + "hasfree", + "opname", + "opmap", + "HAVE_ARGUMENT", + "EXTENDED_ARG", + "hasnargs", + "stack_effect", +] + if sys.version_info >= (3, 9): cmp_op: tuple[Literal["<"], Literal["<="], Literal["=="], Literal["!="], Literal[">"], Literal[">="]] else: @@ -28,8 +45,8 @@ hasfree: list[int] opname: list[str] opmap: dict[str, int] -HAVE_ARGUMENT: int -EXTENDED_ARG: int +HAVE_ARGUMENT: Literal[90] +EXTENDED_ARG: Literal[144] if sys.version_info >= (3, 8): def stack_effect(__opcode: int, __oparg: int | None = ..., *, jump: bool | None = ...) -> int: ...