diff --git a/django-stubs/utils/functional.pyi b/django-stubs/utils/functional.pyi index 9809cf13b4..f20e807991 100644 --- a/django-stubs/utils/functional.pyi +++ b/django-stubs/utils/functional.pyi @@ -20,7 +20,25 @@ class cached_property(Generic[_T]): @overload def __get__(self, instance: object, cls: Type[Any] = ...) -> _T: ... -class Promise: ... +# Promise is only subclassed by a proxy class defined in the lazy function +# so it makes sense for it to have all the methods available in that proxy class +class Promise: + def __init__(self, args: Any, kw: Any) -> None: ... + def __reduce__(self) -> Tuple[Any, Tuple[Any]]: ... + @classmethod + def __prepare_class__(cls) -> None: ... + @classmethod + def __promise__(cls, method_name: str) -> Callable: ... + def __text_cast(self) -> str: ... + def __bytes_cast(self) -> bytes: ... + def __bytes_cast_encoded(self) -> bytes: ... + def __cast(self) -> Union[bytes, str]: ... + def __lt__(self, other: Any) -> bool: ... + def __hash__(self) -> int: ... + def __mod__(self, rhs: Any) -> str: ... + def __add__(self, other: Any) -> str: ... + def __radd__(self, other: Any) -> str: ... + def __deepcopy__(self, memo: Any): ... _C = TypeVar("_C", bound=Callable)