sbdchd / django-types

:doughnut: Type stubs for Django
MIT License
188 stars 62 forks source link

Fix aiterator() signature. #262

Closed john-parton closed 1 month ago

john-parton commented 1 month ago

Queryset.aiterator() was set up to by annotated as async () -> Iterator which implies the call semantics are

for obj in await queryset.aiterator():
    ...

But what we actually want is

async for obj in queryset.aiterator():
   ...

Updated signature to match Django

john-parton commented 1 month ago

Rebased/force-pushed to avoid warning from CI

sbdchd commented 1 month ago

Thanks!