Skip to content

Commit 9288c34

Browse files
authored
fix @classproperty return type (#58)
1 parent 70050f2 commit 9288c34

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

django-stubs/utils/decorators.pyi

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
from typing import Any, Callable, Optional, Set, Tuple, Type, Union
22

3-
from django.middleware.cache import CacheMiddleware
4-
from django.test.testcases import LiveServerTestCase
53
from django.utils.deprecation import MiddlewareMixin
64

75
class classonlymethod(classmethod): ...
86

97
def method_decorator(
108
decorator: Union[Callable, Set[Callable], Tuple[Callable, Callable]], name: str = ...
119
) -> Callable: ...
12-
def decorator_from_middleware_with_args(middleware_class: Type[CacheMiddleware]) -> Callable: ...
10+
def decorator_from_middleware_with_args(middleware_class: Type[MiddlewareMixin]) -> Callable: ...
1311
def decorator_from_middleware(middleware_class: Type[MiddlewareMixin]) -> Callable: ...
1412
def available_attrs(fn: Any): ...
1513
def make_middleware_decorator(middleware_class: Type[MiddlewareMixin]) -> Callable: ...
1614

1715
class classproperty:
1816
fget: Optional[Callable] = ...
1917
def __init__(self, method: Optional[Callable] = ...) -> None: ...
20-
def __get__(self, instance: Optional[LiveServerTestCase], cls: Type[LiveServerTestCase] = ...) -> str: ...
18+
def __get__(self, instance: Any, cls: Optional[type] = ...) -> Any: ...
2119
def getter(self, method: Callable) -> classproperty: ...

0 commit comments

Comments
 (0)