From 2295b14214684dfd18062970e7944cfb470307ea Mon Sep 17 00:00:00 2001 From: Peter Law Date: Mon, 1 Jul 2019 16:49:40 +0100 Subject: [PATCH] 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. --- django-stubs/utils/decorators.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django-stubs/utils/decorators.pyi b/django-stubs/utils/decorators.pyi index 7a2b811..397beb8 100644 --- a/django-stubs/utils/decorators.pyi +++ b/django-stubs/utils/decorators.pyi @@ -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: ...