Visitar URL original
iscoroutinefunction doesn't work for partial bound methods · Issue #95444 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20260828065250/https://github.com/python/cpython/issues/95444
Skip to content
/ cpython Public

iscoroutinefunction doesn't work for partial bound methods #95444

Description

@pdewacht

Bug report

iscoroutinefunction doesn't work for partial bound methods. Consider this example. The second assert fails.

import asyncio
import functools

class A:
    async def a(self, x, y):
        pass

assert asyncio.iscoroutinefunction(A().a)
assert asyncio.iscoroutinefunction(functools.partial(A().a, 1))

I found two related issues:

Your environment

  • CPython versions tested on: Python 3.10.5
  • Operating system and architecture: Debian unstable, amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions