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

@@ -2,13 +2,13 @@ import gzip
import http.client
import sys
import time
from _typeshed import ReadableBuffer, Self, SupportsRead, SupportsWrite, _BufferWithLen
from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite, _BufferWithLen
from collections.abc import Callable, Iterable, Mapping
from datetime import datetime
from io import BytesIO
from types import TracebackType
from typing import Any, Protocol, overload
from typing_extensions import Literal, TypeAlias
from typing_extensions import Literal, Self, TypeAlias
class _SupportsTimeTuple(Protocol):
def timetuple(self) -> time.struct_time: ...
@@ -312,7 +312,7 @@ class ServerProxy:
def __call__(self, attr: Literal["transport"]) -> Transport: ...
@overload
def __call__(self, attr: str) -> Callable[[], None] | Transport: ...
def __enter__(self: Self) -> Self: ...
def __enter__(self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...