On Sun, Jul 2, 2017 at 8:18 PM, Alex Walters <tritium-l...@sdamon.com> wrote:
> Before async/await it made sense that iscoroutine and iscoroutinefunction
> live in asyncio.  But now that coroutines are a built in type, supported by
> its own syntax, wouldn't it make sense to make those functions builtins?

Technically "builtins" refers to the functions like "len" that are
automatically available without having to be imported; this is a
pretty select set of functions, and iscoroutine{,function} are
unlikely to qualify.

However, there are now versions of iscoroutine and iscoroutinefunction
that live in the "inspect" module, and which do what you'd expect for
native built-in coroutines. The versions in the asyncio module are a
little different; they also recognize various objects that asyncio
wants to treat like coroutines, like generators decorated with
@asyncio.coroutine.

-n

-- 
Nathaniel J. Smith -- https://vorpus.org
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to