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
PEP 492: Documentation #68368
Comments
Please find attached a docs patch for PEP-492 changes. I'd really appreciate if someone can review it / help me with it. I think it's important to have at least some documentation shipped with beta-1, so that people start testing the feature. |
Patch looks worth merging to me. Some minor questions/quibbles: Asynchronous iterator question: should the typical pattern for those be: def __aiter__(self):
return self
def __await__(self):
return self "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. The What's New entry can be tweaked to replace "proposes" with "added". |
New changeset 548d5704fcb3 by Yury Selivanov in branch 'default': |
Thanks for the review Nick. I committed the patch with some additional minor fixes, including your suggestion.
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__
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). |
Hi Yury, Here is a post commit review. I've mostly removed some additional PEP-492 mentions and made a couple of trivial changes. |
New changeset 5691d2d2d0a4 by Yury Selivanov in branch 'default': |
Hi Berker, thanks for the review. I think all your edits are reasonable, so I've just committed your patch as is. |
Closing this issue. |
New changeset 3eb817e19090 by Yury Selivanov in branch '3.5': New changeset ca489c50fbd1 by Yury Selivanov in branch 'default': |
New changeset 8a185bb62a25 by Yury Selivanov in branch '3.5': New changeset 10f92b4d55ed by Yury Selivanov in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: