osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: improve TypeError for AsyncIterables when attempting to sync iterate


Currently when attempting to sync iterate an async iterable you get a
TypeError:

TypeError: 'SomeType' object is not iterable

When attempting to iterate an async iterable (eg an object with a __aiter__
method the error could be something like:

TypeError: 'SomeType' object is not iterable, it is however an
AsyncIterable. Use `async for` instead.