Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
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