asyncdef / aitertools

Async versions of the Python itertools features.
Apache License 2.0
20 stars 4 forks source link

aitertools.aiter behaviour #2

Closed xdmiodz closed 6 years ago

xdmiodz commented 8 years ago

Hi,

It seems to me, that the method aitertools.aiter should ignore both __anext__ and __next__ methods inside of the passed iterable. I think it contradicts to the original iter's implementation and leads to inconsistencies .

kevinconway commented 8 years ago

I believe you are right. I'm not sure how I originally came to the conclusion that iterators should be returned if detected, but that is different than the documented behaviour of iter.

To make sure we're talking about the same issue, here's an example sequence of events as they should occur when only one argument is given to aiter:

If you are interested in removing the check for __anext__ I would welcome the patch and ask that you bump the minor version and add one or two tests for aiter. I should have some time soon to patch this as well.

xdmiodz commented 8 years ago

Sure, will provide a patch soon