Skip to content

@overload of async functions #470

Closed

Description

@crusaderky

Since #435, pyflakes git tip copes with synchronous @overload'ed functions, but not with async ones:

from typing import overload

@overload
def f(x: int) -> int:
    ...

@overload
def f(x: float) -> float:
    ...

def f(x):
    return x

@overload
async def g(x: int) -> int:
    ...

@overload
async def g(x: float) -> float:
    ...

async def g(x):
    return x
$ python -m pyflakes .

18:1 redefinition of unused 'g' from line 14
22:1 redefinition of unused 'g' from line 18

Activity

  1. asottile commented on Sep 23, 2019

    @asottile
    Member

    thanks for the issue and reproduction! I've created #472 for that -- please try it out and let me know if it fixes the bug

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions