What do you need help with?
When using pyatv in homeassistant I came across the following error being reported by mypy:
Example:
device_ids = ['foo', 'bar']
atv.audio.set_output_devices(*device_ids)
Error:
Argument 1 to "set_output_devices" of "Audio" has incompatible type "*list[str]"; expected "list[str]"
It appears that I am calling the function correctly, i.e. passing a str for each argument, so I am wondering if the declarations are correct.
The code declares the types as follows:
async def set_output_devices(self, *devices: List[str]) -> None:
Mypy states the following for arguments:
# This says each positional arg and each keyword arg is a "str"
def call(self, *args: str, **kwargs: str) -> str:
...
To me this suggests that *_output_devices(...) functions should be declared as e.g.:
async def set_output_devices(self, *devices: str) -> None:
Is that correct?
What do you need help with?
When using pyatv in homeassistant I came across the following error being reported by mypy:
Example:
Error:
It appears that I am calling the function correctly, i.e. passing a
strfor each argument, so I am wondering if the declarations are correct.The code declares the types as follows:
Mypy states the following for arguments:
To me this suggests that
*_output_devices(...)functions should be declared as e.g.:Is that correct?