New submission from Yury Selivanov:

Stefan,

This patch should solve the problem with types.coroutine accepting only pure 
python generator functions.

The approach is, however, slightly different from what you've proposed.  
Instead of having a wrapper class (delegating .throw, .send etc to a wrapped 
object), we now simply check if the returned value of the wrapped function is 
an instance of collections.abc.Coroutine.  Issue 24315 enables duck typing for 
coroutines, so if a cython-based coroutine implements all coroutine abstract 
methods, it will automatically pass types.coroutine.

----------
assignee: yselivanov
components: Library (Lib)
files: coroutine.patch
keywords: patch
messages: 244315
nosy: gvanrossum, ncoghlan, scoder, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: Fix types.coroutine to accept objects from Cython
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39536/coroutine.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24316>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to