Fwd: improve TypeError for AsyncIterables when attempting to sync iterate

Thomas Grainger tagrain at gmail.com
Sun Feb 10 10:45:16 EST 2019


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.



More information about the Python-list mailing list