Closed
Description
I have a rather large type alias to figure out what the msgpack
library can serialize.
from typing import (cast, Any, Callable, Dict, Iterable, Iterator, List, NamedTuple, Sequence, Tuple, Union)
_MsgPackable_ = Union[None, bool, int, float, str, bytes]
_MsgPackable = Union[_MsgPackable_, List[_MsgPackable_], Tuple[_MsgPackable_, ...], Dict[str, _MsgPackable_]]
MsgPackable = Union[_MsgPackable, List[_MsgPackable], Tuple[_MsgPackable, ...], Dict[str, _MsgPackable]]
def test_method():
#type: () -> Iterator[MsgPackable]
return ((x, x) for x in range(30))
However, the above generates an error from your library. Yet your documentation suggests that something like this should work.
I get that this is a fairly complex usage, but I'm unsure how else to do this sort of thing. Can you help?