from _typeshed import ExcInfo
from collections.abc import Callable
from typing import Generic, TypeVar

_T = TypeVar("_T")

class HookCallError(Exception): ...

class _Result(Generic[_T]):
    def __init__(self, result: _T | None, exception: BaseException | None) -> None: ...
    @property
    def excinfo(self) -> ExcInfo | None: ...
    @property
    def exception(self) -> BaseException | None: ...
    @classmethod
    def from_call(cls, func: Callable[[], _T]) -> _Result[_T]: ...
    def force_result(self, result: _T) -> None: ...
    def force_exception(self, exception: BaseException) -> None: ...
    def get_result(self) -> _T: ...
