Closed jonathon-love closed 4 years ago
Hi @jonathon-love, sorry for the late reply!
The issue here is that you forgot to use the stream method:
xs = stream.enumerate(analysis.results)
async with xs.stream() as s:
async for i, r in s:
print(r)
I know it is a bit confusing, but streams can be iterated multiple times so a new streamer object has to be created for each usage. I think we need at least a better exception message than AttributeError: __aexit__
so people don't get too confused about it. I'll rename the issue.
Thanks for the report!
ah! my bad!
thanks for the response.
Fixed! Thanks again for the report @jonathon-love
hi i can use enumerate() improperly and it works as expected, i.e.:
but of course i get the
UserWarning: AsyncIteratorContext is iterated outside of its context
but when i try and do it properly:
i get an
AttributeError: __aexit__
on thewith
line.i assume this is a bug (or am i misunderstanding something)?
with thanks