mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-23 11:32:07 +08:00
Audit stdlib object annotations (#9519)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import ssl
|
||||
import sys
|
||||
from _typeshed import FileDescriptorLike, ReadableBuffer, Self, StrPath, WriteableBuffer
|
||||
from _typeshed import FileDescriptorLike, ReadableBuffer, Self, StrPath, Unused, WriteableBuffer
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Awaitable, Callable, Coroutine, Generator, Sequence
|
||||
from contextvars import Context
|
||||
@@ -96,7 +96,7 @@ class AbstractServer:
|
||||
@abstractmethod
|
||||
def close(self) -> None: ...
|
||||
async def __aenter__(self: Self) -> Self: ...
|
||||
async def __aexit__(self, *exc: object) -> None: ...
|
||||
async def __aexit__(self, *exc: Unused) -> None: ...
|
||||
@abstractmethod
|
||||
def get_loop(self) -> AbstractEventLoop: ...
|
||||
@abstractmethod
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import enum
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from _typeshed import Self, Unused
|
||||
from collections import deque
|
||||
from collections.abc import Callable, Generator
|
||||
from types import TracebackType
|
||||
@@ -31,7 +31,7 @@ else:
|
||||
class _ContextManager:
|
||||
def __init__(self, lock: Lock | Semaphore) -> None: ...
|
||||
def __enter__(self) -> None: ...
|
||||
def __exit__(self, *args: object) -> None: ...
|
||||
def __exit__(self, *args: Unused) -> None: ...
|
||||
|
||||
class _ContextManagerMixin:
|
||||
# Apparently this exists to *prohibit* use as a context manager.
|
||||
@@ -104,7 +104,7 @@ if sys.version_info >= (3, 11):
|
||||
class Barrier(_LoopBoundMixin):
|
||||
def __init__(self, parties: int) -> None: ...
|
||||
async def __aenter__(self: Self) -> Self: ...
|
||||
async def __aexit__(self, *args: object) -> None: ...
|
||||
async def __aexit__(self, *args: Unused) -> None: ...
|
||||
async def wait(self) -> int: ...
|
||||
async def abort(self) -> None: ...
|
||||
async def reset(self) -> None: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from _typeshed import Self, Unused
|
||||
from collections.abc import Callable, Coroutine
|
||||
from contextvars import Context
|
||||
from typing import Any, TypeVar
|
||||
@@ -18,7 +18,7 @@ if sys.version_info >= (3, 11):
|
||||
class Runner:
|
||||
def __init__(self, *, debug: bool | None = ..., loop_factory: Callable[[], AbstractEventLoop] | None = ...) -> None: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(self, exc_type: object, exc_val: object, exc_tb: object) -> None: ...
|
||||
def __exit__(self, exc_type: Unused, exc_val: Unused, exc_tb: Unused) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def get_loop(self) -> AbstractEventLoop: ...
|
||||
def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = ...) -> _T: ...
|
||||
|
||||
Reference in New Issue
Block a user