mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-19 10:21:14 +08:00
Fix missing argument types in py3 stdlib (#995)
Still missing a few in _subprocess (a Windows-only private module) and decimal (I gave up).
This commit is contained in:
committed by
Guido van Rossum
parent
01b3915b3f
commit
11350ed8cc
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, Generator, Iterable, Iterator, TypeVar, Union
|
||||
from typing import Any, Callable, Generator, Iterable, Iterator, TypeVar, Union, Optional
|
||||
|
||||
from .coroutines import coroutine
|
||||
from .events import AbstractEventLoop
|
||||
@@ -49,11 +49,11 @@ class Condition(_ContextManagerMixin):
|
||||
def notify_all(self) -> None: ...
|
||||
|
||||
class Semaphore(_ContextManagerMixin):
|
||||
def __init__(self, value: int = 1, *, loop: AbstractEventLoop = None) -> None: ...
|
||||
def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ...
|
||||
def locked(self) -> bool: ...
|
||||
@coroutine
|
||||
def acquire(self) -> Generator[Any, None, bool]: ...
|
||||
def release(self) -> None: ...
|
||||
|
||||
class BoundedSemaphore(Semaphore):
|
||||
def __init__(self, value=1, *, loop: AbstractEventLoop = None) -> None: ...
|
||||
def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ...
|
||||
|
||||
@@ -15,7 +15,7 @@ FIRST_COMPLETED = 'FIRST_COMPLETED'
|
||||
ALL_COMPLETED = 'ALL_COMPLETED'
|
||||
|
||||
def as_completed(fs: Sequence[_FutureT[_T]], *, loop: AbstractEventLoop = ...,
|
||||
timeout=None) -> Iterator[Generator[Any, None, _T]]: ...
|
||||
timeout: Optional[float] = ...) -> Iterator[Generator[Any, None, _T]]: ...
|
||||
def ensure_future(coro_or_future: _FutureT[_T],
|
||||
*, loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
# TODO: gather() should use variadic type vars instead of _TAny.
|
||||
|
||||
Reference in New Issue
Block a user