diff --git a/path/classes.pyi b/path/classes.pyi index 0e119d0..4f23e41 100644 --- a/path/classes.pyi +++ b/path/classes.pyi @@ -1,8 +1,13 @@ -from typing import Any, Callable, Optional +from typing import Any, Callable, Generic, TypeVar, overload class ClassProperty(property): def __get__(self, cls: Any, owner: type | None = ...) -> Any: ... -class multimethod: - def __init__(self, func: Callable[..., Any]): ... - def __get__(self, instance: Any, owner: type | None) -> Any: ... +_T = TypeVar("_T") + +class multimethod(Generic[_T]): + def __init__(self, func: Callable[..., _T]): ... + @overload + def __get__(self, instance: None, owner: type[_T] | None) -> Callable[..., _T]: ... + @overload + def __get__(self, instance: _T, owner: type[_T] | None) -> Callable[..., _T]: ...