asyncstdlib
asyncstdlib copied to clipboard
[Bug]: error: Value of type variable "LT" of "min" cannot be "Coroutine[Any, Any, Decimal]"
What happened?
Mypy displays this error when I pass an async function in the key parameter of asyncstdlib.min.
$ mypy file.py --strict
file.py:X: error: Value of type variable "LT" of "min" cannot be "Coroutine[Any, Any, int]" [type-var]
Minimal Reproducible Example
import asyncio
import asyncstdlib as a
async def my_custom_getter(item: int) -> int:
# awaits here
return item
async def example():
await a.min([1, 2, 3], key=my_custom_getter)
asyncio.run(example())
Request Assignment [Optional]
- [ ] I already understand the cause and want to submit a bugfix.
Thanks for the report. Looks like the overloads for the async case are missing here. This is also the case for some other functions in builtins.