[issue27243] __aiter__ should return async iterator instead of awaitable

2016-11-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset a0d50aad7b02 by Yury Selivanov in branch '3.6': Issue #27243: Change PendingDeprecationWarning -> DeprecationWarning. https://hg.python.org/cpython/rev/a0d50aad7b02 New changeset 9550f0d22d27 by Yury Selivanov in branch 'default': Merge 3.6 (issue

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-11 Thread Yury Selivanov
Yury Selivanov added the comment: > I didn’t realize, sorry for the noise Actually thanks for reporting this, Martin. I didn't realize that sys.version_info was 3.5.1 in 3.5 branch. -- ___ Python tracker

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-10 Thread Martin Panter
Martin Panter added the comment: I didn’t realize, sorry for the noise -- status: open -> closed ___ Python tracker ___

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-10 Thread Yury Selivanov
Yury Selivanov added the comment: This is because sys.version_info is 3.5.1 (not 3.5.2 yet) in the "3.5" branch. Once 3.5.2 RC is tagged the warning will disappear. https://github.com/python/cpython/blob/master/Lib/asyncio/streams.py#L693 -- ___

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-09 Thread Martin Panter
Martin Panter added the comment: Test suite emits a new warning, and fails under python -Werror: == ERROR: test_readline (test.test_asyncio.test_pep492.StreamReaderTests)

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-09 Thread Yury Selivanov
Yury Selivanov added the comment: I've also updated PEP 492: https://hg.python.org/peps/rev/fef4b9969b9d Please feel free to post to this issue if you think that I should have covered it differently or in more detail. -- ___ Python tracker

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-09 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks a lot, Nick! I've merged the patch. -- resolution: -> fixed stage: -> resolved status: open -> closed type: -> enhancement ___ Python tracker

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 93ad47d63b87 by Yury Selivanov in branch '3.5': Issue #27243: Fix __aiter__ protocol https://hg.python.org/cpython/rev/93ad47d63b87 New changeset 9ff95c30a38e by Yury Selivanov in branch 'default': Merge 3.5 (issue #27243)

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-09 Thread Nick Coghlan
Nick Coghlan added the comment: +1 from me - my only comments were on the docs updates and one of the explanatory comments in the code. -- ___ Python tracker

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-08 Thread Yury Selivanov
Yury Selivanov added the comment: Nick, Please see the updated patch. Do you think it's ready to be merged? I want buildbots to have some time with it before RC. -- Added file: http://bugs.python.org/file43307/fix_aiter3.patch ___ Python tracker

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread Nick Coghlan
Nick Coghlan added the comment: Yury's proposal sounds good to me - I'll have time to do a proper review tomorrow (at a quick glance, my one suggestion is to move the if statement outside the example decorator, so the decorator is defined differently based on the Python version, rather than

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread Yury Selivanov
Yury Selivanov added the comment: Updated patch (fix_aiter2.patch) -- Added file: http://bugs.python.org/file43268/fix_aiter2.patch ___ Python tracker

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread Yury Selivanov
Yury Selivanov added the comment: > Can you guys get this solid and checked in before then? Will do my best. I'll update the patch soon with some code comments and docs. -- ___ Python tracker

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread Larry Hastings
Larry Hastings added the comment: Okay. I'm hoping to not delay 3.5.2 RC1, and the schedule calls for me to tag the release Saturday afternoon. Can you guys get this solid and checked in before then? -- ___ Python tracker

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread Guido van Rossum
Guido van Rossum added the comment: Unless Nick disagrees (or unless we can't figure out how to implement it) I think Yury's proposal makes sense. So if Larry is asking for my fiat, this is it. -- ___ Python tracker

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread Yury Selivanov
Yury Selivanov added the comment: It's a rather long & conservative process, but it will be easier for people to migrate their code. -- ___ Python tracker

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread Yury Selivanov
Yury Selivanov added the comment: > While I agree this needs to be fixed, one key piece of documentation needed > will be to cover how to write an __aiter__ method that does the right thing > on both 3.5.1 and 3.5.2+ (and also avoids the deprecation warning in the > latter case). Oh, this is

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread Larry Hastings
Larry Hastings added the comment: As RM my default position is naturally "don't change behavior in point releases". I'm willing to be overruled by the BDFL, less so by anybody else. -- ___ Python tracker

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread Nick Coghlan
Nick Coghlan added the comment: Since the old behaviour is only deprecated with Yury's changes, rather than disallowed entirely, I think it makes sense to provide a 3.5.x version that also supports the new behaviour. In addition to my docs comment above, the other thing I noticed in reviewing

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread Guido van Rossum
Guido van Rossum added the comment: Would it be easier to handle for everyone if this did not vary between 3.5.0/1 and 3.5.2, and instead was an incompatibility in 3.6? (That would still be allowed given 492's provisional status.) -- nosy: +ned.deily

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread Nick Coghlan
Nick Coghlan added the comment: While I agree this needs to be fixed, one key piece of documentation needed will be to cover how to write an __aiter__ method that does the right thing on both 3.5.1 and 3.5.2+ (and also avoids the deprecation warning in the latter case). (I've also added

[issue27243] __aiter__ should return async iterator instead of awaitable

2016-06-06 Thread Yury Selivanov
New submission from Yury Selivanov: There is a small flaw in PEP 492 design -- __aiter__ should not return an awaitable object that resolves to an asynchronous iterator. It should return an asynchronous iterator directly. Let me explain this by showing some examples. I've discovered this