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,9 +1,9 @@
import sys
from _typeshed import Self, SupportsWrite
from _typeshed import SupportsWrite
from collections.abc import Generator, Iterable, Iterator, Mapping
from types import FrameType, TracebackType
from typing import Any, overload
from typing_extensions import Literal, TypeAlias
from typing_extensions import Literal, Self, TypeAlias
__all__ = [
"extract_stack",
@@ -129,7 +129,7 @@ class TracebackException:
) -> None: ...
@classmethod
def from_exception(
cls: type[Self],
cls,
exc: BaseException,
*,
limit: int | None = ...,
@@ -154,7 +154,7 @@ class TracebackException:
) -> None: ...
@classmethod
def from_exception(
cls: type[Self],
cls,
exc: BaseException,
*,
limit: int | None = ...,
@@ -176,7 +176,7 @@ class TracebackException:
) -> None: ...
@classmethod
def from_exception(
cls: type[Self], exc: BaseException, *, limit: int | None = ..., lookup_lines: bool = ..., capture_locals: bool = ...
cls, exc: BaseException, *, limit: int | None = ..., lookup_lines: bool = ..., capture_locals: bool = ...
) -> Self: ...
def __eq__(self, other: object) -> bool: ...