Message243758
Thanks for the review Nick. I committed the patch with some additional minor fixes, including your suggestion.
> Asynchronous iterator question: should the typical pattern for those be:
def __aiter__(self):
return self
def __await__(self):
return self
Well, adding __await__ to asynchronous iterators is the same as adding __call__ to regular iterators. It would be like:
i = iter(iterable) # __iter__
i = iterable() # __call__
ai = await iterable.__aiter__() # __aiter__
# or "ai = await aiter(iterable)", but we don't have it yet
ai = await iterable # __await__
> "Did we put the ABC's in the right place?" question: reviewing the draft docs meant I just noticed that collections.abc is quite an odd home for some of these. Probably not worth worrying about, given that AsyncIterator and AsyncIterable do belong, and the others are building blocks for those.
I had this question too. My impression is that Guido doesn't want to fix this in 3.5. FWIW, my initial suggestion was to have "Coroutine", "Awaitable" and "Hashable" in the top-level "abc" module (not ideal by any means). |
|
Date |
User |
Action |
Args |
2015-05-21 15:55:34 | yselivanov | set | recipients:
+ yselivanov, gvanrossum, ncoghlan, vstinner, asvetlov, python-dev |
2015-05-21 15:55:34 | yselivanov | set | messageid: <1432223734.41.0.46244961647.issue24180@psf.upfronthosting.co.za> |
2015-05-21 15:55:34 | yselivanov | link | issue24180 messages |
2015-05-21 15:55:34 | yselivanov | create | |
|