mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-12 19:30:53 +08:00
Add @disjoint_base decorator in the stdlib (#14599)
And fix some other new stubtest finds.
This commit is contained in:
+39
-33
@@ -3,7 +3,7 @@ import types
|
||||
from collections.abc import Callable, Iterator
|
||||
from opcode import * # `dis` re-exports it as a part of public API
|
||||
from typing import IO, Any, Final, NamedTuple
|
||||
from typing_extensions import Self, TypeAlias
|
||||
from typing_extensions import Self, TypeAlias, disjoint_base
|
||||
|
||||
__all__ = [
|
||||
"code_info",
|
||||
@@ -88,39 +88,45 @@ else:
|
||||
starts_line: int | None
|
||||
is_jump_target: bool
|
||||
|
||||
class Instruction(_Instruction):
|
||||
if sys.version_info < (3, 13):
|
||||
if sys.version_info >= (3, 12):
|
||||
class Instruction(_Instruction):
|
||||
if sys.version_info < (3, 13):
|
||||
def _disassemble(self, lineno_width: int = 3, mark_as_current: bool = False, offset_width: int = 4) -> str: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
@property
|
||||
def oparg(self) -> int: ...
|
||||
@property
|
||||
def baseopcode(self) -> int: ...
|
||||
@property
|
||||
def baseopname(self) -> str: ...
|
||||
@property
|
||||
def cache_offset(self) -> int: ...
|
||||
@property
|
||||
def end_offset(self) -> int: ...
|
||||
@property
|
||||
def jump_target(self) -> int: ...
|
||||
@property
|
||||
def is_jump_target(self) -> bool: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
@staticmethod
|
||||
def make(
|
||||
opname: str,
|
||||
arg: int | None,
|
||||
argval: Any,
|
||||
argrepr: str,
|
||||
offset: int,
|
||||
start_offset: int,
|
||||
starts_line: bool,
|
||||
line_number: int | None,
|
||||
label: int | None = None,
|
||||
positions: Positions | None = None,
|
||||
cache_info: list[tuple[str, int, Any]] | None = None,
|
||||
) -> Instruction: ...
|
||||
|
||||
else:
|
||||
@disjoint_base
|
||||
class Instruction(_Instruction):
|
||||
def _disassemble(self, lineno_width: int = 3, mark_as_current: bool = False, offset_width: int = 4) -> str: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
@property
|
||||
def oparg(self) -> int: ...
|
||||
@property
|
||||
def baseopcode(self) -> int: ...
|
||||
@property
|
||||
def baseopname(self) -> str: ...
|
||||
@property
|
||||
def cache_offset(self) -> int: ...
|
||||
@property
|
||||
def end_offset(self) -> int: ...
|
||||
@property
|
||||
def jump_target(self) -> int: ...
|
||||
@property
|
||||
def is_jump_target(self) -> bool: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
@staticmethod
|
||||
def make(
|
||||
opname: str,
|
||||
arg: int | None,
|
||||
argval: Any,
|
||||
argrepr: str,
|
||||
offset: int,
|
||||
start_offset: int,
|
||||
starts_line: bool,
|
||||
line_number: int | None,
|
||||
label: int | None = None,
|
||||
positions: Positions | None = None,
|
||||
cache_info: list[tuple[str, int, Any]] | None = None,
|
||||
) -> Instruction: ...
|
||||
|
||||
class Bytecode:
|
||||
codeobj: types.CodeType
|
||||
|
||||
Reference in New Issue
Block a user