mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Use _typeshed.Self where __enter__ returns self (#5698)
This commit is contained in:
committed by
GitHub
parent
1fb100dca4
commit
58559e56b3
@@ -1,6 +1,7 @@
|
||||
import socket
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import Self
|
||||
from typing import Any, Iterable, List, Optional, Tuple, Type, Union
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
@@ -48,7 +49,7 @@ class Listener:
|
||||
def address(self) -> _Address: ...
|
||||
@property
|
||||
def last_accepted(self) -> Optional[_Address]: ...
|
||||
def __enter__(self) -> Listener: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], exc_tb: Optional[types.TracebackType]
|
||||
) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user