mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 08:17:08 +08:00
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:
committed by
Maxim Kurnikov
parent
a77d5b27d8
commit
2295b14214
@@ -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
|
from django.utils.deprecation import MiddlewareMixin
|
||||||
|
|
||||||
class classonlymethod(classmethod): ...
|
class classonlymethod(classmethod): ...
|
||||||
|
|
||||||
def method_decorator(
|
def method_decorator(
|
||||||
decorator: Union[Callable, Set[Callable], Tuple[Callable, Callable]], name: str = ...
|
decorator: Union[Callable, Iterable[Callable]], name: str = ...
|
||||||
) -> Callable: ...
|
) -> Callable: ...
|
||||||
def decorator_from_middleware_with_args(middleware_class: Type[MiddlewareMixin]) -> 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: ...
|
||||||
|
|||||||
Reference in New Issue
Block a user