django-stubs icon indicating copy to clipboard operation
django-stubs copied to clipboard

Return type of send method

Open dinauu opened this issue 3 years ago • 1 comments

Why does this send method have to return List[Tuple[Callable, Optional[str]]]? I have a receiver that returns List[Tuple[Callable, Dict[str, Any]]] and I get this error:

Incompatible types in assignment (expression has type "List[Tuple[Callable[..., Any], Optional[str]]]", variable has type "List[Tuple[Callable[..., Any], Dict[Any, Any]]]")

dinauu avatar Feb 03 '22 14:02 dinauu

A receiver can return any type, сan't it? But why there is an Optional[str] in the signature of method .send?

pokidovea avatar Feb 03 '22 14:02 pokidovea