| Store | Cart

Re: [Python-Dev] PEP 492: No new syntax is required

From: Glenn Linderman <v+py...@g.nevcal.com>
Tue, 28 Apr 2015 09:46:53 -0700
On 4/26/2015 4:32 PM, Paul Sokolovsky wrote:
> Then, is the only logic for proposing __aenter__ is to reinsure against> a situation that someone starts to write async context manager, forgets> that they write async context manager, and make an __enter__ method> there. Then your implementation will announce that "async context> manager lacks __aenter__", whereas "my" approach would announce> "Async's manager __enter__ did not return awaitable value".>> Again, is that the distinction you're shooting for, or do I miss> something?

Seems like the missing __aenter__ can easily be detected by the 
interpreter at compile time, but the wrong type returned would be at run 
time, or after a complex type-analysis done at compile time (unlikely to 
be practical).

So I think you've nailed the distinction... but I'm not the expert.

_______________________________________________
Python-Dev mailing list
Pyth...@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/python-dev-ml%40activestate.com

Recent Messages in this Thread
Mark Shannon Apr 26, 2015 08:21 pm
yoav glazner Apr 26, 2015 08:26 pm
Yury Selivanov Apr 26, 2015 08:40 pm
Mark Shannon Apr 26, 2015 09:48 pm
Brett Cannon Apr 26, 2015 10:09 pm
Yury Selivanov Apr 26, 2015 10:16 pm
Yury Selivanov Apr 26, 2015 10:12 pm
Nick Coghlan Apr 26, 2015 10:24 pm
Mark Shannon Apr 27, 2015 08:09 am
Paul Sokolovsky Apr 26, 2015 10:25 pm
Yury Selivanov Apr 26, 2015 10:49 pm
Paul Sokolovsky Apr 26, 2015 11:32 pm
Yury Selivanov Apr 26, 2015 11:45 pm
Paul Sokolovsky Apr 27, 2015 12:17 am
Yury Selivanov Apr 27, 2015 12:39 am
Paul Sokolovsky Apr 27, 2015 10:48 pm
Glenn Linderman Apr 28, 2015 04:46 pm
Guido van Rossum Apr 26, 2015 11:13 pm
Paul Sokolovsky Apr 26, 2015 11:50 pm
Mark Shannon Apr 27, 2015 07:48 am
Stefan Behnel Apr 28, 2015 06:51 pm
Guido van Rossum Apr 28, 2015 08:00 pm
Paul Sokolovsky Apr 28, 2015 07:24 pm
Mark Shannon Apr 28, 2015 07:59 pm
Paul Sokolovsky Apr 28, 2015 09:14 pm
Messages in this thread