GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-122858: Deprecate `asyncio.iscoroutinefunction` by Wulian233 · Pull Request #122875 · python/cpython

Conversation

@Wulian233

@Wulian233 Wulian233 commented Aug 10, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Same inspect.iscoroutinefunction, we don't need two different functions to do the same thing.

  • Issue: Deprecate asyncio.iscoroutinefunction #122858

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Wulian233
Deprecate :func:asyncio.iscoroutinefunction in favor of :func:`insp…
1036f01
…ect.iscoroutinefunction`.
@Wulian233
Wulian233 requested review from 1st1, asvetlov, cjw296, gvanrossum, kumaraditya303 and willingc as code owners August 10, 2024 02:25
@bedevere-app bedevere-app Bot mentioned this pull request Aug 10, 2024
Deprecate asyncio.iscoroutinefunction #122858
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Aug 10, 2024
Wulian233 added 3 commits August 10, 2024 10:27
@Wulian233
gh:122875
228d2f2
@Wulian233
typo
c831bb1
@Wulian233
fix
d48ed66
@Wulian233
Wulian233 marked this pull request as draft August 10, 2024 02:52
@bedevere-app bedevere-app Bot removed the awaiting review label Aug 10, 2024
Wulian233 added 2 commits August 10, 2024 10:55
@Wulian233
fix
7aae62f
@Wulian233
fix
ae0b8f0
@Wulian233

Wulian233 commented Aug 10, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

After my many fix, maybe it is normal for the Docs workflow to fail because the deprecated function asyncio.iscoroutinefunctiondoes not have a corresponding document page introduction

But I don't know how to solve this problem. Delete whatnew/3.14.rst: func: iscoroutinefunctiondoes?

(Solved)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Wulian233
Wulian233 marked this pull request as ready for review August 10, 2024 04:15
@bedevere-app bedevere-app Bot added the awaiting review label Aug 10, 2024
kumaraditya303
kumaraditya303 reviewed Aug 10, 2024
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

kumaraditya303
kumaraditya303 reviewed Aug 10, 2024
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@kumaraditya303
Apply suggestions from code review
62b8d3b
kumaraditya303
kumaraditya303 reviewed Aug 10, 2024
View reviewed changes
Comment thread Lib/asyncio/unix_events.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@cjw296
cjw296 removed their request for review August 10, 2024 09:31
Wulian233 added 2 commits August 10, 2024 19:00
@Wulian233
use coroutines.iscoroutine and coroutines._iscoroutinefunction
750d294
@Wulian233
import coroutines
78655aa
kumaraditya303
kumaraditya303 reviewed Aug 10, 2024
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2024-08-10-10-21-44.gh-issue-122858.ZC1rJD.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@kumaraditya303
Update Misc/NEWS.d/next/Library/2024-08-10-10-21-44.gh-issue-122858.Z…
58013d5
…C1rJD.rst
kumaraditya303
kumaraditya303 reviewed Aug 10, 2024
View reviewed changes
Comment thread Lib/unittest/mock.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Wulian233
from inspect import iscoroutinefunction
1be0d66
sobolevn
sobolevn reviewed Aug 11, 2024
View reviewed changes

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use at least one test that ensures that the function is deprecated (which does not ignore the warnings).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kumaraditya303

kumaraditya303 commented Aug 11, 2024

Copy link
Copy Markdown
Contributor

I am taking over this now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kumaraditya303
fix tests
d8c86c6
kumaraditya303
kumaraditya303 approved these changes Aug 11, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Aug 11, 2024
@kumaraditya303
kumaraditya303 enabled auto-merge (squash) August 11, 2024 16:15
@kumaraditya303
kumaraditya303 merged commit bc9d92c into python:main Aug 11, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Aug 11, 2024
@Wulian233
Wulian233 deleted the asyncio branch August 11, 2024 23:16
@ZeroIntensity ZeroIntensity mentioned this pull request Aug 19, 2024
Reflect deprecation for asyncio.iscoroutinefunction python/typeshed#12558
Closed
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
@Wulian233 @kumaraditya303 @blhsing
pythongh-122858: Deprecate asyncio.iscoroutinefunction (python#122875)
2e65db5
Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`.

Co-authored-by: Kumar Aditya <[email protected]>
AdamWill pushed a commit to AdamWill/cached-property that referenced this pull request Nov 5, 2024
@encukou @AdamWill
Use iscoroutinefunction from inspect not asyncio
cb1f82b
Python 3.14 will deprecate asyncio.iscoroutinefunction:
python/cpython#122875

inspect.iscoroutinefunction exists since 3.5 and our baseline
is 3.8, so we can just use it unconditionally.

Using a wrapper with @asyncio.coroutine in __get__ wasn't
necessary (the future from asyncio.ensure_future is awaitable,
and the wrapper doesn't do anything asynchronous), so the
logic can be simplified to just call asyncio.ensure_future
(to schedule the task and store the result when it's
available).
@AdamWill AdamWill mentioned this pull request Nov 5, 2024
Use iscoroutinefunction from inspect not asyncio pydanny/cached-property#359
Open
layday added a commit to layday/aiohttp that referenced this pull request Mar 29, 2025
@layday
Replace asyncio.iscoroutinefunction with inspect.iscoroutinefunction
1efe72f
`asyncio.iscoroutinefunction` was deprecated in python/cpython#122875.
This was referenced Mar 29, 2025
Replace deprecated asyncio.iscoroutinefunction with its counterpart from inspect aio-libs/aiohttp#10634
Merged
Replace deprecated asyncio.iscoroutinefunction with its counterpart… aio-libs/aiohttp#10663
Merged
Replace deprecated asyncio.iscoroutinefunction with its counterpart… aio-libs/aiohttp#10664
Merged
@paultiq paultiq mentioned this pull request Aug 13, 2025
asyncio.iscoroutinefunction() deprecation warnings in Python 3.14 tox-dev/filelock#431
Closed
@edgarrmondragon edgarrmondragon mentioned this pull request Oct 6, 2025
fix: Use inspect.iscoroutinefunction instead of asyncio.iscoroutinefunction to address deprecation warning in Python 3.14+ litestar-org/litestar#4405
Merged
jenshnielsen added a commit to jenshnielsen/opentelemetry-python that referenced this pull request Oct 22, 2025
@jenshnielsen
Fix python 3.14 deprecation warning
a36e923
asyncio.iscoroutinefunction is a wrapper around inspect.iscoroutinefunction and has been deprecated in 3.14

See python/cpython#122875 for reference
@jenshnielsen jenshnielsen mentioned this pull request Nov 3, 2025
Python 3.14 support open-telemetry/opentelemetry-python#4789
Closed
@jonathan343 jonathan343 mentioned this pull request Nov 25, 2025
Replace deprecated asyncio.iscoroutinefunction with inspect.iscoroutinefunction smithy-lang/smithy-python#608
Merged
@servusdei2018 servusdei2018 mentioned this pull request Dec 16, 2025
refactor(twisted/consumer): update asyncio.iscoroutinefunction to inspect.iscoroutine fedora-infra/fedora-messaging#558
Closed
@donbarbos donbarbos mentioned this pull request Dec 26, 2025
Add asyncio 3.14 deprecations python/typeshed#15176
Merged
@commonism commonism mentioned this pull request Mar 8, 2026
Python3.14 - DeprecationWarning: 'asyncio.iscoroutinefunction' MagicStack/uvloop#731
Closed
@mertyuks3l mertyuks3l mentioned this pull request Mar 30, 2026
Fix DeprecationWarning: asyncio.iscoroutinefunction on Python 3.14 canbula/ParallelProgramming#1075
Open
3 tasks done
@sobolevn sobolevn mentioned this pull request May 9, 2026
Remove deprecated asyncio.iscoroutinefunction for 3.16 #149600
Closed
@HanGhoul HanGhoul mentioned this pull request Jul 15, 2026
Fix: asyncio.get_event_loop not creating loop & asyncio.iscoroutinefunction deprecation hslarson/Faster-Twitch-Alerts#2
Open
@coderabbitai coderabbitai Bot mentioned this pull request Jul 31, 2026
Add ARC Prize 2024 Lattice Law Solver ProCityHub/GARVIS#13
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sobolevn sobolevn sobolevn left review comments
@kumaraditya303 kumaraditya303 kumaraditya303 approved these changes
@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov is a code owner
@gvanrossum gvanrossum Awaiting requested review from gvanrossum
@willingc willingc Awaiting requested review from willingc willingc is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Wulian233 @kumaraditya303 @sobolevn
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.