[Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted

Yuriy Taraday yorik.sar at gmail.com
Wed Jan 9 04:56:17 CET 2013


On Wed, Jan 9, 2013 at 6:31 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:

> On Wed, Jan 9, 2013 at 11:14 AM, Yuriy Taraday <yorik.sar at gmail.com>
> wrote:
> > 4. Why separate exception() from result() for Future class? It does the
> same
> > as result() but with different interface (return instead of raise).
> Doesn't
> > this violate the rule "There should be one obvious way to do it"?
>
> The exception() method exists for the same reason that we support both
> "key in mapping" and raising KeyError from "mapping[key]": sometimes
> you want "Look Before You Leap", other times you want to let the
> exception fly. If you want the latter, just call .result() directly,
> if you want the former, check .exception() first.
>

Ok, I get it now. Thank you for clarifying.


> Regardless, the Future API isn't really being defined in PEP 3156, as
> it is mostly inheritied from the previously implemented PEP 3148
> (http://www.python.org/dev/peps/pep-3148/#future-objects)
>

Then #3 and #4 are about PEP 3148. Why was it done this way?

Kind regards, Yuriy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130109/bddfdacf/attachment.html>


More information about the Python-Dev mailing list