-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change in behavior of chain() between 3.10.5 and 3.10.6. #107
Comments
Here's a construction of class _Chain1:
def __call__(self, *iterables):
async def impl():
for iterable in iterables:
async with asl.scoped_iter(iterable) as iterator:
async for item in iterator:
yield item
return impl()
# Add other async methods here...
chain = _Chain1() |
It looks like this is due to a missing |
maxfischer2781
added a commit
that referenced
this issue
Apr 12, 2023
5 tasks
maxfischer2781
added a commit
that referenced
this issue
Apr 16, 2023
* added chain.aclose method for cleanup (closes #107) * do not reconstruct chain implementation again and again * use same implementation for chain and chain.from_iterable * chain owns explicitly passed iterables
The fix you committed passes all my tests. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a subtle change in behavior introduced in the recent changes to
chain()
. Chain's iterator appears to be escaping from its "scope" when it is interrupted.Here is an example program that produces different output. I'm using Python 3.11.2, but I don't think the Python version makes much difference.
asyncstdlib 3.10.5 (correct output)
asyncstdlib 3.10.6 (incorrect output)
The text was updated successfully, but these errors were encountered: