| 1 |
import _typeshed |
| 2 |
import sys |
| 3 |
from _typeshed import SupportsWrite |
| 4 |
from collections.abc import Callable |
| 5 |
from typing import Any, Literal, TypeVar |
| 6 |
from typing_extensions import Concatenate, ParamSpec, deprecated |
| 7 |
|
| 8 |
_T = TypeVar("_T") |
| 9 |
_R_co = TypeVar("_R_co", covariant=True) |
| 10 |
_FuncT = TypeVar("_FuncT", bound=Callable[..., Any]) |
| 11 |
_P = ParamSpec("_P") |
| 12 |
|
| 13 |
|
| 14 |
class ABCMeta(type): |
| 15 |
__abstractmethods__: frozenset[str] |
| 16 |
if sys.version_info >= (3, 11): |
| 17 |
def __new__( |
| 18 |
mcls: type[_typeshed.Self], name: str, bases: tuple[type, ...], namespace: dict[str, Any], /, **kwargs: Any |
| 19 |
) -> _typeshed.Self: ... |
| 20 |
else: |
| 21 |
def __new__( |
| 22 |
mcls: type[_typeshed.Self], name: str, bases: tuple[type, ...], namespace: dict[str, Any], **kwargs: Any |
| 23 |
) -> _typeshed.Self: ... |
| 24 |
|
| 25 |
def __instancecheck__(cls: ABCMeta, instance: Any, /) -> bool: ... |
| 26 |
def __subclasscheck__(cls: ABCMeta, subclass: type, /) -> bool: ... |
| 27 |
def _dump_registry(cls: ABCMeta, file: SupportsWrite[str] | None = None) -> None: ... |
| 28 |
def register(cls: ABCMeta, subclass: type[_T]) -> type[_T]: ... |
| 29 |
|
| 30 |
def abstractmethod(funcobj: _FuncT) -> _FuncT: ... |
| 31 |
@deprecated("Deprecated since Python 3.3. Use `@classmethod` stacked on top of `@abstractmethod` instead.") |
| 32 |
class abstractclassmethod(classmethod[_T, _P, _R_co]): |
| 33 |
__isabstractmethod__: Literal[True] |
| 34 |
def __init__(self, callable: Callable[Concatenate[type[_T], _P], _R_co]) -> None: ... |
| 35 |
|
| 36 |
@deprecated("Deprecated since Python 3.3. Use `@staticmethod` stacked on top of `@abstractmethod` instead.") |
| 37 |
class abstractstaticmethod(staticmethod[_P, _R_co]): |
| 38 |
__isabstractmethod__: Literal[True] |
| 39 |
def __init__(self, callable: Callable[_P, _R_co]) -> None: ... |
| 40 |
|
| 41 |
@deprecated("Deprecated since Python 3.3. Use `@property` stacked on top of `@abstractmethod` instead.") |
| 42 |
class abstractproperty(property): |
| 43 |
__isabstractmethod__: Literal[True] |
| 44 |
|
| 45 |
class ABC(metaclass=ABCMeta): |
| 46 |
__slots__ = () |
| 47 |
|
| 48 |
def get_cache_token() -> object: ... |
| 49 |
|
| 50 |
if sys.version_info >= (3, 10): |
| 51 |
def update_abstractmethods(cls: type[_T]) -> type[_T]: ... |