Skip to content

Return value missing from async __annotations__ #2884

@phlax

Description

@phlax

The __annotations__ signature produced for async functions doesn't include the return value

testing these python functions

async def async_fun(arg1: dict) -> str:
    pass


def fun(arg1: dict) -> str:
    pass

against these compiled py functions

async def cy_async_fun(dict arg1, arg2: dict) -> str:
    pass

def cy_fun(dict arg1, arg2: dict) -> str:
    pass

I see the following __annotations__

Python: not async
{'return': <class 'str'>, 'arg1': <class 'dict'>}

Python: async
{'return': <class 'str'>, 'arg1': <class 'dict'>}


Cython compiled: async
{'arg2': 'dict'}

Cython compiled: not async
{'arg2': 'dict', 'return': 'unicode'}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions