mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-26 05:41:11 +08:00
Added some missing types from various stdlib stubs (#4466)
This commit is contained in:
@@ -2,7 +2,7 @@ import array
|
||||
import threading
|
||||
import weakref
|
||||
from queue import Queue as Queue
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, Callable, Iterable, List, Mapping, Optional, Sequence
|
||||
|
||||
JoinableQueue = Queue
|
||||
Barrier = threading.Barrier
|
||||
@@ -19,7 +19,14 @@ class DummyProcess(threading.Thread):
|
||||
_pid: None
|
||||
_start_called: int
|
||||
exitcode: Optional[int]
|
||||
def __init__(self, group=..., target=..., name=..., args=..., kwargs=...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
group: Any = ...,
|
||||
target: Optional[Callable[..., Any]] = ...,
|
||||
name: Optional[str] = ...,
|
||||
args: Iterable[Any] = ...,
|
||||
kwargs: Mapping[str, Any] = ...,
|
||||
) -> None: ...
|
||||
|
||||
Process = DummyProcess
|
||||
|
||||
@@ -32,11 +39,13 @@ class Value:
|
||||
_typecode: Any
|
||||
_value: Any
|
||||
value: Any
|
||||
def __init__(self, typecode, value, lock=...) -> None: ...
|
||||
def __init__(self, typecode: Any, value: Any, lock: Any = ...) -> None: ...
|
||||
|
||||
def Array(typecode, sequence, lock=...) -> array.array[Any]: ...
|
||||
def Array(typecode: Any, sequence: Sequence[Any], lock: Any = ...) -> array.array[Any]: ...
|
||||
def Manager() -> Any: ...
|
||||
def Pool(processes=..., initializer=..., initargs=...) -> Any: ...
|
||||
def Pool(
|
||||
processes: Optional[int] = ..., initializer: Optional[Callable[..., Any]] = ..., initargs: Iterable[Any] = ...
|
||||
) -> Any: ...
|
||||
def active_children() -> List[Any]: ...
|
||||
def current_process() -> threading.Thread: ...
|
||||
def freeze_support() -> None: ...
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
from queue import Queue
|
||||
from typing import Any, List, Optional, Tuple, TypeVar
|
||||
from types import TracebackType
|
||||
from typing import Any, List, Optional, Tuple, Type, TypeVar, Union
|
||||
|
||||
families: List[None]
|
||||
|
||||
_TConnection = TypeVar("_TConnection", bound=Connection)
|
||||
_TListener = TypeVar("_TListener", bound=Listener)
|
||||
_Address = Union[str, Tuple[str, int]]
|
||||
|
||||
class Connection(object):
|
||||
_in: Any
|
||||
@@ -14,8 +16,10 @@ class Connection(object):
|
||||
send: Any
|
||||
send_bytes: Any
|
||||
def __enter__(self: _TConnection) -> _TConnection: ...
|
||||
def __exit__(self, exc_type, exc_value, exc_tb) -> None: ...
|
||||
def __init__(self, _in, _out) -> None: ...
|
||||
def __exit__(
|
||||
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
|
||||
) -> None: ...
|
||||
def __init__(self, _in: Any, _out: Any) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def poll(self, timeout: float = ...) -> bool: ...
|
||||
|
||||
@@ -24,10 +28,12 @@ class Listener(object):
|
||||
@property
|
||||
def address(self) -> Optional[Queue[Any]]: ...
|
||||
def __enter__(self: _TListener) -> _TListener: ...
|
||||
def __exit__(self, exc_type, exc_value, exc_tb) -> None: ...
|
||||
def __init__(self, address=..., family=..., backlog=...) -> None: ...
|
||||
def __exit__(
|
||||
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
|
||||
) -> None: ...
|
||||
def __init__(self, address: Optional[_Address] = ..., family: Optional[int] = ..., backlog: int = ...) -> None: ...
|
||||
def accept(self) -> Connection: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
def Client(address) -> Connection: ...
|
||||
def Client(address: _Address) -> Connection: ...
|
||||
def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ...
|
||||
|
||||
Reference in New Issue
Block a user