Various asyncio classes: remove the loop argument on 3.10 (#9630)

This commit is contained in:
Alex Waygood
2023-01-31 00:55:08 +00:00
committed by GitHub
parent 94065d3aa5
commit 8a098a8601
3 changed files with 26 additions and 10 deletions

View File

@@ -45,20 +45,20 @@ else:
) -> None: ...
class Lock(_ContextManagerMixin):
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 10):
def __init__(self) -> None: ...
else:
def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ...
def __init__(self, *, loop: AbstractEventLoop | None = None) -> None: ...
def locked(self) -> bool: ...
async def acquire(self) -> Literal[True]: ...
def release(self) -> None: ...
class Event:
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 10):
def __init__(self) -> None: ...
else:
def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ...
def __init__(self, *, loop: AbstractEventLoop | None = None) -> None: ...
def is_set(self) -> bool: ...
def set(self) -> None: ...
@@ -66,10 +66,10 @@ class Event:
async def wait(self) -> Literal[True]: ...
class Condition(_ContextManagerMixin):
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 10):
def __init__(self, lock: Lock | None = None) -> None: ...
else:
def __init__(self, lock: Lock | None = None, *, loop: AbstractEventLoop | None = ...) -> None: ...
def __init__(self, lock: Lock | None = None, *, loop: AbstractEventLoop | None = None) -> None: ...
def locked(self) -> bool: ...
async def acquire(self) -> Literal[True]: ...
@@ -82,10 +82,10 @@ class Condition(_ContextManagerMixin):
class Semaphore(_ContextManagerMixin):
_value: int
_waiters: deque[Future[Any]]
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 10):
def __init__(self, value: int = 1) -> None: ...
else:
def __init__(self, value: int = 1, *, loop: AbstractEventLoop | None = ...) -> None: ...
def __init__(self, value: int = 1, *, loop: AbstractEventLoop | None = None) -> None: ...
def locked(self) -> bool: ...
async def acquire(self) -> Literal[True]: ...