mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Use typing_extensions.Self in the stdlib (#9694)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user