From 6b39050d528dbd60be8199d2239ab8ff6a78976d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20K=C3=A1rolyi?= Date: Fri, 26 Aug 2022 22:43:32 +0000 Subject: [PATCH] Updating deconstructible (#1116) * Updating deconstructible * Black * Update deconstruct.pyi Co-authored-by: Nikita Sobolev --- django-stubs/utils/deconstruct.pyi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/django-stubs/utils/deconstruct.pyi b/django-stubs/utils/deconstruct.pyi index 99f4b4a..bc9d638 100644 --- a/django-stubs/utils/deconstruct.pyi +++ b/django-stubs/utils/deconstruct.pyi @@ -1,3 +1,9 @@ -from typing import Any, Optional +from typing import Any, Callable, Optional, TypeVar, overload -def deconstructible(*args: Any, path: Optional[Any] = ...) -> Any: ... +_T = TypeVar("_T") +_TCallable = TypeVar("_TCallable", bound=Callable[..., Any]) + +@overload +def deconstructible(_type: type[_T]) -> type[_T]: ... +@overload +def deconstructible(*, path: Optional[str] = ...) -> Callable[[_TCallable], _TCallable]: ...