Use _typeshed.Self where __enter__ returns self (#5698)

This commit is contained in:
Dominic Davis-Foster
2021-06-27 20:58:58 +01:00
committed by GitHub
parent 1fb100dca4
commit 58559e56b3
7 changed files with 16 additions and 9 deletions

View File

@@ -1,3 +1,4 @@
from _typeshed import Self
from email.message import Message as _Message
from socket import socket
from ssl import SSLContext
@@ -75,7 +76,7 @@ class SMTP:
timeout: float = ...,
source_address: Optional[_SourceAddress] = ...,
) -> None: ...
def __enter__(self) -> SMTP: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], tb: Optional[TracebackType]
) -> None: ...