Use _typeshed.Self with __enter__ (#5712)

This commit is contained in:
Anton Grübel authored and GitHub committed 2021-06-29 15:19:25 -07:00
1 parent 35cc7491db
commit c38171a0b3
8 files changed
+24 -27

No files matched your search

+3 -5
View File
@@ -1,12 +1,10 @@
from _typeshed import SupportsRead, SupportsReadline
from _typeshed import Self, SupportsRead, SupportsReadline
from socket import socket
from ssl import SSLContext
from types import TracebackType
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, TextIO, Tuple, Type, TypeVar, Union
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, TextIO, Tuple, Type, Union
from typing_extensions import Literal
_T = TypeVar("_T")
MSG_OOB: int
FTP_PORT: int
MAXLINE: int
@@ -34,7 +32,7 @@ class FTP:
lastresp: str
file: Optional[TextIO]
encoding: str
def __enter__(self: _T) -> _T: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> None: ...