From a8c9c194b4658b5b830a70fef7db3919afb51688 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 10 Jan 2022 14:07:04 +0300 Subject: [PATCH] Improve `cmp_op` in `opcode` (#6884) --- stdlib/opcode.pyi | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/stdlib/opcode.pyi b/stdlib/opcode.pyi index 982ddee43..69588c369 100644 --- a/stdlib/opcode.pyi +++ b/stdlib/opcode.pyi @@ -1,7 +1,23 @@ import sys -from typing import Sequence +from typing_extensions import Literal -cmp_op: Sequence[str] +if sys.version_info >= (3, 9): + cmp_op: tuple[Literal["<"], Literal["<="], Literal["=="], Literal["!="], Literal[">"], Literal[">="]] +else: + cmp_op: tuple[ + Literal["<"], + Literal["<="], + Literal["=="], + Literal["!="], + Literal[">"], + Literal[">="], + Literal["in"], + Literal["not in"], + Literal["is"], + Literal["is not"], + Literal["exception match"], + Literal["BAD"], + ] hasconst: list[int] hasname: list[int] hasjrel: list[int]