dis: add adaptive argument for 3.11 (#7889)

This commit is contained in:
Jelle Zijlstra
2022-05-19 18:27:34 -07:00
committed by GitHub
parent 64766c8521
commit 4220712aab
2 changed files with 22 additions and 13 deletions

View File

@@ -80,9 +80,12 @@ class Bytecode:
first_line: int | None = ...,
current_offset: int | None = ...,
show_caches: bool = ...,
adaptive: bool = ...,
) -> None: ...
@classmethod
def from_traceback(cls: type[Self], tb: types.TracebackType, *, show_caches: bool = ...) -> Self: ...
def from_traceback(
cls: type[Self], tb: types.TracebackType, *, show_caches: bool = ..., adaptive: bool = ...
) -> Self: ...
else:
def __init__(
self, x: _HaveCodeOrStringType, *, first_line: int | None = ..., current_offset: int | None = ...
@@ -103,7 +106,12 @@ def code_info(x: _HaveCodeOrStringType) -> str: ...
if sys.version_info >= (3, 11):
def dis(
x: _HaveCodeOrStringType | None = ..., *, file: IO[str] | None = ..., depth: int | None = ..., show_caches: bool = ...
x: _HaveCodeOrStringType | None = ...,
*,
file: IO[str] | None = ...,
depth: int | None = ...,
show_caches: bool = ...,
adaptive: bool = ...,
) -> None: ...
elif sys.version_info >= (3, 7):
@@ -113,10 +121,18 @@ else:
def dis(x: _HaveCodeOrStringType | None = ..., *, file: IO[str] | None = ...) -> None: ...
if sys.version_info >= (3, 11):
def disassemble(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ..., show_caches: bool = ...) -> None: ...
def disco(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ..., show_caches: bool = ...) -> None: ...
def distb(tb: types.TracebackType | None = ..., *, file: IO[str] | None = ..., show_caches: bool = ...) -> None: ...
def get_instructions(x: _HaveCodeType, *, first_line: int | None = ..., show_caches: bool = ...) -> Iterator[Instruction]: ...
def disassemble(
co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ..., show_caches: bool = ..., adaptive: bool = ...
) -> None: ...
def disco(
co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ..., show_caches: bool = ..., adaptive: bool = ...
) -> None: ...
def distb(
tb: types.TracebackType | None = ..., *, file: IO[str] | None = ..., show_caches: bool = ..., adaptive: bool = ...
) -> None: ...
def get_instructions(
x: _HaveCodeType, *, first_line: int | None = ..., show_caches: bool = ..., adaptive: bool = ...
) -> Iterator[Instruction]: ...
else:
def disassemble(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ...