Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return value missing from async __annotations__ #2884

Closed
phlax opened this issue Mar 4, 2019 · 1 comment
Closed

Return value missing from async __annotations__ #2884

phlax opened this issue Mar 4, 2019 · 1 comment

Comments

@phlax
Copy link

phlax commented Mar 4, 2019

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'}

@scoder
Copy link
Contributor

scoder commented Mar 4, 2019

Thanks for the detailed report, that made it very easy to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants