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,6 +1,6 @@
import sys
from _socket import _Address as _SourceAddress
from _typeshed import ReadableBuffer, Self, _BufferWithLen
from _typeshed import ReadableBuffer, _BufferWithLen
from collections.abc import Sequence
from email.message import Message as _Message
from re import Pattern
@@ -8,7 +8,7 @@ from socket import socket
from ssl import SSLContext
from types import TracebackType
from typing import Any, Protocol, overload
from typing_extensions import TypeAlias
from typing_extensions import Self, TypeAlias
__all__ = [
"SMTPException",
@@ -95,7 +95,7 @@ class SMTP:
timeout: float = ...,
source_address: _SourceAddress | None = None,
) -> None: ...
def __enter__(self: Self) -> Self: ...
def __enter__(self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None
) -> None: ...