Allow any iterable to be passed to method_decorator (#90)

From reading the source of Django 2.1.9, this seems to be what's
allowed there.

Fixes https://github.com/mkurnikov/django-stubs/issues/78.
This commit is contained in:
Peter Law
2019-07-01 16:49:40 +01:00
committed by Maxim Kurnikov
parent a77d5b27d8
commit 2295b14214

View File

@@ -1,11 +1,11 @@
from typing import Any, Callable, Optional, Set, Tuple, Type, Union
from typing import Any, Callable, Iterable, Optional, Type, Union
from django.utils.deprecation import MiddlewareMixin
class classonlymethod(classmethod): ...
def method_decorator(
decorator: Union[Callable, Set[Callable], Tuple[Callable, Callable]], name: str = ...
decorator: Union[Callable, Iterable[Callable]], name: str = ...
) -> Callable: ...
def decorator_from_middleware_with_args(middleware_class: Type[MiddlewareMixin]) -> Callable: ...
def decorator_from_middleware(middleware_class: Type[MiddlewareMixin]) -> Callable: ...