Skip to content

async/await checks are too aggressive and even escape type: ignore #2959

Closed
@timabbott

Description

@timabbott

I happen to use a third-party library (Mandrill) that has various functions that take the async keyword:

https://mandrillapp.com/api/docs/index.python.html

The error is this, and it applies even if you add a type: ignore on the affected line:
/tmp/foo.py:1: error: 'async' and 'await' will become reserved keywords in Python 3.7

def foo(async=True):                                                                                 
    pass                                                                                             
                                                                                                     
foo(async=False)  # type: ignore                                                                     

You get the same thing with even this:

x = dict(async=False)  # type: ignore                                                                

Other keywords don't have this problem (x = dict(type=False) works fine), so I think this is just a bug with this new friendly check for new keywords.

I worked around this by passing **{'async': False} instead, but it's kinda absurd.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions