mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-15 08:17:07 +08:00
Make multiprocessing pipes generic (#11137)
This commit is contained in:
@@ -47,10 +47,13 @@ class BaseContext:
|
||||
# N.B. Keep this in sync with multiprocessing.connection.Pipe.
|
||||
# _ConnectionBase is the common base class of Connection and PipeConnection
|
||||
# and can be used in cross-platform code.
|
||||
#
|
||||
# The two connections should have the same generic types but inverted (Connection[_T1, _T2], Connection[_T2, _T1]).
|
||||
# However, TypeVars scoped entirely within a return annotation is unspecified in the spec.
|
||||
if sys.platform != "win32":
|
||||
def Pipe(self, duplex: bool = True) -> tuple[Connection, Connection]: ...
|
||||
def Pipe(self, duplex: bool = True) -> tuple[Connection[Any, Any], Connection[Any, Any]]: ...
|
||||
else:
|
||||
def Pipe(self, duplex: bool = True) -> tuple[PipeConnection, PipeConnection]: ...
|
||||
def Pipe(self, duplex: bool = True) -> tuple[PipeConnection[Any, Any], PipeConnection[Any, Any]]: ...
|
||||
|
||||
def Barrier(
|
||||
self, parties: int, action: Callable[..., object] | None = None, timeout: float | None = None
|
||||
|
||||
Reference in New Issue
Block a user