This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients asvetlov, gvanrossum, ncoghlan, scoder, vstinner, yselivanov
Date 2015-05-10.03:34:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1431228848.8.0.9239103174.issue24017@psf.upfronthosting.co.za>
In-reply-to
Content
Review sent - very nice work on this Yury.

Highlights:

* I concur with Stefan that we should have a full PyCoroutineMethods struct at the C level, with a "tp_as_coroutine" pointer to that replacing the current tp_reserved slot

* I also concur with Stefan about adding a Coroutine ABC

* PyType_FromSpec (and typeslots.h) will need updating once we agree on a slot structure (with my recommendation being "define C level slots for all of the new PEP 492 methods")

* I found CO_COROUTINE/CO_NATIVE_COROUTINE confusing as a reader of the implementation, as they only told me how the objects were defined, rather than telling me why I should care. Based on what I gleaned of their intended purpose from reading the implementation, I suggest switching this to instead use CO_COROUTINE (set for all coroutines, regardless of how they were defined) and CO_ITERABLE_COROUTINE (set only for those coroutines that also support iteration), and adjusting the naming of other APIs accordingly.

* I found the names of the WITH_CLEANUP_ENTER and WITH_CLEANUP_EXIT bytecodes misleading, as they don't refer to the corresponding context management phases - they're both related to the "exit" phase. WITH_CLEANUP_START and WITH_CLEANUP_FINISH should be clearer for readers (both of the implementation and of the disassembled bytecode).
History
Date User Action Args
2015-05-10 03:34:09ncoghlansetrecipients: + ncoghlan, gvanrossum, scoder, vstinner, asvetlov, yselivanov
2015-05-10 03:34:08ncoghlansetmessageid: <1431228848.8.0.9239103174.issue24017@psf.upfronthosting.co.za>
2015-05-10 03:34:08ncoghlanlinkissue24017 messages
2015-05-10 03:34:08ncoghlancreate