deepset-ai / canals

A component orchestration engine
https://deepset-ai.github.io/canals/
Apache License 2.0
27 stars 2 forks source link

Mypy: `Variadic` is not iterable #153

Closed ZanSara closed 10 months ago

ZanSara commented 10 months ago

I've already met a few times with mypy reacting to the following code:

def run(self, values: Variadic[int]):
    for value in values:
        ...

By saying that values is an int, so it's not iterable. That is correct because right now Variadic gives mypy no hint of being an Iterable. We should make Variadic alias a type such as List or Sequence to fix this issue.