Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

typing_extensions.deprecated andwarnings.deprecated remove coroutine property; How to deprecate async functions? #122088

Closed
Assignees
srittau
@Kakadus

Description

@Kakadus

When I annotate an async function with@deprecated(...),inspect.iscoroutinefunction no longer returns True. This is not what I expect to happen, as withpartial fromfunctools this does not happen.

Consider the following code:

importinspectfromfunctoolsimportpartialfromtyping_extensionsimportdeprecatedasyncdefcoroutinefunction_a():pass@deprecated("deprecated coroutine")asyncdefcoroutinefunction_b():passassertinspect.iscoroutinefunction(coroutinefunction_a)isTrue# correctassertinspect.iscoroutinefunction(partial(coroutinefunction_a))isTrue# correctassertinspect.iscoroutinefunction(coroutinefunction_b)isTrue# fail

With typing_extensions and python3.13, the last assertion fails.

This is especially annoying since e.g.libraries useinspect.iscoroutinefunction to detect the type of function.

I am not sure this is the correct place for this bug report, as this both happens with python 3.13 and typing_extensions on older python versions.

Linked PRs

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp