asyncstdlib icon indicating copy to clipboard operation
asyncstdlib copied to clipboard

[Bug]: error: Value of type variable "LT" of "min" cannot be "Coroutine[Any, Any, Decimal]"

Open d3cryptofc opened this issue 1 month ago • 1 comments

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.

d3cryptofc avatar Nov 16 '25 00:11 d3cryptofc

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.

maxfischer2781 avatar Nov 17 '25 12:11 maxfischer2781