[Python-Dev] async/await in Python; v2
Andrew Svetlov
andrew.svetlov at gmail.com
Thu Apr 23 03:50:48 CEST 2015
I guess to raise exception on unwinded async generator in destructor
even in non-debug mode.
Debug mode may have more complex info with source_traceback included,
as Victor Stinner does for CoroWrapper.
On Thu, Apr 23, 2015 at 4:27 AM, Yury Selivanov <yselivanov.ml at gmail.com> wrote:
> Greg,
>
> On 2015-04-22 7:47 PM, Greg Ewing wrote:
>>
>> Yury Selivanov wrote:
>>
>>> On the other hand, I hate the idea
>>> of grammatically requiring parentheses for 'await'
>>> expressions. That feels non-pytonic to me.
>>
>>
>> How is it any different from grammatically requiring
>> parens in an ordinary function call? Nobody ever
>> complained about that.
>
>
> It is different.
>
> 1. Because 'await' keyword might be at a great distance
> from the object you're really calling:
>
> await foo.bar.baz['spam']()
> +-----------------------+
>
> Can I chain the calls:
>
> await foo()() ?
>
> or await foo().bar()?
>
> 2. Because there is no other keyword in python
> with similar behaviour.
>
> 3. Moreover: unless I can write 'await future' - your
> proposal *won't* work with a lot of existing code
> and patterns. It's going to be radically different
> from all other languages that implement 'await' too.
>
> Yury
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/andrew.svetlov%40gmail.com
--
Thanks,
Andrew Svetlov
More information about the Python-Dev
mailing list