Skip to content

Support coroutines #119

Closed
Closed
@1st1

Description

@1st1

Can we add support for coroutine functions? Mainly, I'm curious how we will annotate the return type. We basically have two options:

async def foo() -> typing.Coroutine[str]:
     return 'spam'

or

async def foo() -> str:
     return 'spam'

I'd really prefer the latter style. While the result of 'foo()' is a Coroutine, this is something that type checkers will know without a hint, what really matters is the expected result of await foo() expression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions