mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-17 03:21:25 +08:00
stdlib: add __slots__ (#14611)
This commit is contained in:
1 parent
28abff1eb3
commit
f32d9f08bd
38 files changed
+247
-12
No files matched your search
@@ -47,6 +47,7 @@ _CM_EF = TypeVar("_CM_EF", bound=AbstractContextManager[Any, Any] | _ExitFunc)
|
||||
# allowlist for use as a Protocol.
|
||||
@runtime_checkable
|
||||
class AbstractContextManager(ABC, Protocol[_T_co, _ExitT_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
|
||||
__slots__ = ()
|
||||
def __enter__(self) -> _T_co: ...
|
||||
@abstractmethod
|
||||
def __exit__(
|
||||
@@ -58,6 +59,7 @@ class AbstractContextManager(ABC, Protocol[_T_co, _ExitT_co]): # type: ignore[m
|
||||
# allowlist for use as a Protocol.
|
||||
@runtime_checkable
|
||||
class AbstractAsyncContextManager(ABC, Protocol[_T_co, _ExitT_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
|
||||
__slots__ = ()
|
||||
async def __aenter__(self) -> _T_co: ...
|
||||
@abstractmethod
|
||||
async def __aexit__(
|
||||
|
||||
Reference in new issue
Block a user