Open zsol opened 2 years ago
One approach on the indexer side is to introduce
Annotation = Arrow | Bars | Type
@dataclass
class Arrow:
params: list[Annotation]
returns: Annotation
@dataclass
class Bars:
terms: list[Annotation] # always at least 2 items
And then the indexer would translate all Union[...]
and Callable[...]
annotations into Bars
and Arrow
structures. This would get rid of the ugly edge case described in #8 for callables:
Callable[[], returns]
# =>
Type("Callable", xref, params=[
Type("", None, params=[]), # this would no longer happen
Type("returns", None, None),
])
Instead of
Let's show
And maybe even