Skip to content

PY-ASYN0005 · deprecated_asyncio_coroutine_function_check

Count the coroutine function alias deprecated in Python 3.14.

This is a deterministic rule for python. Read its implementation.

For a configured minimum Python 3 minor version of 14 or newer, resolve qualified, directly imported, and aliased references to asyncio.iscoroutinefunction. The result value and findings count every reference. Use inspect.iscoroutinefunction instead.

Every finding identifies the exact deprecated reference and source range. The value is the number of deprecated alias references.

A compatibility package that deliberately exposes the old spelling can exclude its compatibility module. Ordinary callers need no behavior change because the asyncio name is an alias of the inspect implementation. No automatic fix is offered until import edits can preserve aliases and remove newly unused imports safely. python_minor is the Python 3 minor version the project targets, and the rule reports nothing below 14 because the alias is not deprecated there.

asyncio.iscoroutinefunction(callback) is reported. So is from asyncio import iscoroutinefunction as is_async. Importing inspect and calling inspect.iscoroutinefunction(callback) is accepted. A Python 3.13 configuration produces no finding.

  • Cites “What’s New In Python”. Open reference
  • Cites “The Python Standard Library”, inspect coroutine function predicate. Open reference