Use typing_extensions.Self in the stdlib (#9694)

This commit is contained in:
Alex Waygood
2023-02-09 09:12:13 +00:00
committed by GitHub
parent 10086c06a1
commit 9ed39d8796
98 changed files with 627 additions and 654 deletions

View File

@@ -1,10 +1,9 @@
import sys
import types
from _typeshed import Self
from collections.abc import Callable, Iterator
from opcode import * # `dis` re-exports it as a part of public API
from typing import IO, Any, NamedTuple
from typing_extensions import TypeAlias
from typing_extensions import Self, TypeAlias
__all__ = [
"code_info",
@@ -82,15 +81,13 @@ class Bytecode:
adaptive: bool = False,
) -> None: ...
@classmethod
def from_traceback(
cls: type[Self], tb: types.TracebackType, *, show_caches: bool = False, adaptive: bool = False
) -> Self: ...
def from_traceback(cls, tb: types.TracebackType, *, show_caches: bool = False, adaptive: bool = False) -> Self: ...
else:
def __init__(
self, x: _HaveCodeType | str, *, first_line: int | None = None, current_offset: int | None = None
) -> None: ...
@classmethod
def from_traceback(cls: type[Self], tb: types.TracebackType) -> Self: ...
def from_traceback(cls, tb: types.TracebackType) -> Self: ...
def __iter__(self) -> Iterator[Instruction]: ...
def info(self) -> str: ...