From 9288c3464832f69a52d51798cb2deab71fd0c701 Mon Sep 17 00:00:00 2001 From: Maxim Kurnikov Date: Wed, 27 Mar 2019 23:13:10 +0300 Subject: [PATCH] fix @classproperty return type (#58) --- django-stubs/utils/decorators.pyi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/django-stubs/utils/decorators.pyi b/django-stubs/utils/decorators.pyi index 2acb04f..7a2b811 100644 --- a/django-stubs/utils/decorators.pyi +++ b/django-stubs/utils/decorators.pyi @@ -1,7 +1,5 @@ from typing import Any, Callable, Optional, Set, Tuple, Type, Union -from django.middleware.cache import CacheMiddleware -from django.test.testcases import LiveServerTestCase from django.utils.deprecation import MiddlewareMixin class classonlymethod(classmethod): ... @@ -9,7 +7,7 @@ class classonlymethod(classmethod): ... def method_decorator( decorator: Union[Callable, Set[Callable], Tuple[Callable, Callable]], name: str = ... ) -> Callable: ... -def decorator_from_middleware_with_args(middleware_class: Type[CacheMiddleware]) -> Callable: ... +def decorator_from_middleware_with_args(middleware_class: Type[MiddlewareMixin]) -> Callable: ... def decorator_from_middleware(middleware_class: Type[MiddlewareMixin]) -> Callable: ... def available_attrs(fn: Any): ... def make_middleware_decorator(middleware_class: Type[MiddlewareMixin]) -> Callable: ... @@ -17,5 +15,5 @@ def make_middleware_decorator(middleware_class: Type[MiddlewareMixin]) -> Callab class classproperty: fget: Optional[Callable] = ... def __init__(self, method: Optional[Callable] = ...) -> None: ... - def __get__(self, instance: Optional[LiveServerTestCase], cls: Type[LiveServerTestCase] = ...) -> str: ... + def __get__(self, instance: Any, cls: Optional[type] = ...) -> Any: ... def getter(self, method: Callable) -> classproperty: ...