fix @classproperty return type (#58)

This commit is contained in:
Maxim Kurnikov
2019-03-27 23:13:10 +03:00
committed by GitHub
parent 70050f28b9
commit 9288c34648
+2 -4
View File
@@ -1,7 +1,5 @@
from typing import Any, Callable, Optional, Set, Tuple, Type, Union 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 from django.utils.deprecation import MiddlewareMixin
class classonlymethod(classmethod): ... class classonlymethod(classmethod): ...
@@ -9,7 +7,7 @@ class classonlymethod(classmethod): ...
def method_decorator( def method_decorator(
decorator: Union[Callable, Set[Callable], Tuple[Callable, Callable]], name: str = ... decorator: Union[Callable, Set[Callable], Tuple[Callable, Callable]], name: str = ...
) -> Callable: ... ) -> 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 decorator_from_middleware(middleware_class: Type[MiddlewareMixin]) -> Callable: ...
def available_attrs(fn: Any): ... def available_attrs(fn: Any): ...
def make_middleware_decorator(middleware_class: Type[MiddlewareMixin]) -> Callable: ... def make_middleware_decorator(middleware_class: Type[MiddlewareMixin]) -> Callable: ...
@@ -17,5 +15,5 @@ def make_middleware_decorator(middleware_class: Type[MiddlewareMixin]) -> Callab
class classproperty: class classproperty:
fget: Optional[Callable] = ... fget: Optional[Callable] = ...
def __init__(self, method: Optional[Callable] = ...) -> None: ... 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: ... def getter(self, method: Callable) -> classproperty: ...