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 iritkatriel
Recipients iritkatriel, lisroach, moriyoshi, xtreak
Date 2020-08-25.10:58:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1598353099.87.0.439968938399.issue40573@roundup.psfhosted.org>
In-reply-to
Content
The two implementations of iscoroutinefunction are implemented differently: 

in inspect:
def iscoroutinefunction(obj):
    """Return true if the object is a coroutine function.
    Coroutine functions are defined with "async def" syntax.
    """
    return _has_code_flag(obj, CO_COROUTINE)

and in asyncio: 
def iscoroutinefunction(func):
    """Return True if func is a decorated coroutine function."""
    return (inspect.iscoroutinefunction(func) or
            getattr(func, '_is_coroutine', None) is _is_coroutine)


originally the asyncio version had only the _is_coroutine check:
https://github.com/python/cpython/commit/f951d28ac890063e3ecef56aa8cf851b1152d9dd

the inspect check was added later.

See also issue28703, where the asyncio version was fixed to handle mock objects.  Looks like the inspect version needs to be fixed as well.
History
Date User Action Args
2020-08-25 10:58:19iritkatrielsetrecipients: + iritkatriel, moriyoshi, lisroach, xtreak
2020-08-25 10:58:19iritkatrielsetmessageid: <1598353099.87.0.439968938399.issue40573@roundup.psfhosted.org>
2020-08-25 10:58:19iritkatriellinkissue40573 messages
2020-08-25 10:58:19iritkatrielcreate