from collections.abc import Callable, Generator, Iterable
from contextlib import contextmanager
from types import TracebackType
from typing import Any, TypeVar

_T = TypeVar("_T")
_ExcT = TypeVar("_ExcT", bound=BaseException)

FILENO_ERRORS: tuple[type[Exception], ...]

class UnsupportedOperation(Exception): ...

def detect_environment() -> str: ...
def entrypoints(namespace: str) -> Iterable[Any]: ...
def fileno(f: Any) -> int: ...
def maybe_fileno(f: Any) -> int | None: ...
@contextmanager
def nested(*managers: Any) -> Generator[tuple[Any, ...], None, None]: ...
def register_after_fork(obj: Any, func: Callable[..., Any]) -> None: ...
def reraise(tp: type[_ExcT], value: _ExcT, tb: TracebackType | None = ...) -> _ExcT: ...
def coro(gen: Callable[..., Generator[_T, Any, Any]]) -> Callable[..., _T]: ...
