Author yselivanov
Recipients brett.cannon, gvanrossum, haypo, larry, lukasz.langa, ncoghlan, ned.deily, yselivanov
Date 2016-06-06.20:58:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1465246723.7.0.789246568392.issue27243@psf.upfronthosting.co.za>
In-reply-to
Content
> 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 tough.

How about we do this:

1. In 3.5.2 we start to support new behaviour. We raise PendingDeprecationWarning.  We update documentation and PEP 492.  The recommended way to write 3.5 code is to keep returning awaitables from __aiter__.  We can add a snippet of code for a compatibility decorator to the docs.

2. In 3.6 we start to raise DeprecationWarning.  The recommended way to write code for 3.6 & 3.7 is to return async iterators from __aiter__.

3. In 3.7 we remove support of the old behaviour.

It's a rather long & conservative process, but it will be
History
Date User Action Args
2016-06-06 20:58:43yselivanovsetrecipients: + yselivanov, gvanrossum, brett.cannon, ncoghlan, haypo, larry, ned.deily, lukasz.langa
2016-06-06 20:58:43yselivanovsetmessageid: <1465246723.7.0.789246568392.issue27243@psf.upfronthosting.co.za>
2016-06-06 20:58:43yselivanovlinkissue27243 messages
2016-06-06 20:58:43yselivanovcreate