Skip to content

Commit bb329f7

Browse files
committed
introduce a TypeAlias instead of a TODO comment
1 parent b6fe703 commit bb329f7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

stubs/docker/docker/transport/npipesocket.pyi

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import io
2-
from _typeshed import Incomplete, ReadableBuffer
3-
from typing import Literal, NoReturn
2+
from _typeshed import ReadableBuffer
3+
from typing import Any, Literal, NoReturn
4+
from typing_extensions import TypeAlias
45

56
cERROR_PIPE_BUSY: int
67
cSECURITY_SQOS_PRESENT: int
@@ -9,17 +10,17 @@ MAXIMUM_RETRY_COUNT: int
910

1011
def check_closed(f): ...
1112

13+
_PyHANDLE: TypeAlias = Any
14+
1215
class NpipeSocket:
13-
# TODO: handle requires the type pywin32._win32typing.PyHANDLE
14-
def __init__(self, handle=None) -> None: ...
16+
def __init__(self, handle: _PyHANDLE | None = None) -> None: ...
1517
def accept(self) -> None: ...
1618
def bind(self, address) -> None: ...
1719
def close(self) -> None: ...
1820
flags: int
1921
def connect(self, address: str, retry_count: int = 0) -> None: ...
2022
def connect_ex(self, address: str) -> None: ...
21-
# TODO: return type requires the type pywin32._win32typing.PyHANDLE
22-
def detach(self) -> Incomplete | None: ...
23+
def detach(self) -> _PyHANDLE | None: ...
2324
def dup(self) -> NpipeSocket: ...
2425
def getpeername(self) -> str: ...
2526
def getsockname(self) -> str: ...

0 commit comments

Comments
 (0)