Add CodeType.co_lines() and CodeType.co_linetable (#6445)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Alex Waygood
2021-11-29 14:49:30 +00:00
committed by GitHub
parent d5f9c95c26
commit aee90a0e82

View File

@@ -123,7 +123,30 @@ class CodeType:
freevars: Tuple[str, ...] = ...,
cellvars: Tuple[str, ...] = ...,
) -> None: ...
if sys.version_info >= (3, 8):
if sys.version_info >= (3, 10):
def replace(
self,
*,
co_argcount: int = ...,
co_posonlyargcount: int = ...,
co_kwonlyargcount: int = ...,
co_nlocals: int = ...,
co_stacksize: int = ...,
co_flags: int = ...,
co_firstlineno: int = ...,
co_code: bytes = ...,
co_consts: Tuple[Any, ...] = ...,
co_names: Tuple[str, ...] = ...,
co_varnames: Tuple[str, ...] = ...,
co_freevars: Tuple[str, ...] = ...,
co_cellvars: Tuple[str, ...] = ...,
co_filename: str = ...,
co_name: str = ...,
co_linetable: object = ...,
) -> CodeType: ...
def co_lines(self) -> Iterator[tuple[int, int, int | None]]: ...
co_linetable: object
elif sys.version_info >= (3, 8):
def replace(
self,
*,