-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
async/await checks are too aggressive and even escape type: ignore
#2959
Comments
I ran into this too. It might be an issue with typed-ast instead but I haven't looked into details yet. |
There are two meanings of the term "keyword". Here, Yet until then I agree that it would be nice if we could suppress the warning somehow. That may require a typed-ast change. @ddfisher? |
Oops, this is definitely a bug in typed-ast. I accidentally turned a conditional warning into an unconditional error when making some fixes for Python 3.3 compatibility. I don't think it's typed-ast's place to warn about this error, so I'm going to remove it instead. |
I'll release 1.0.2 to PyPI as soon as the wheels finish building. |
Released typed-ast 1.0.2. |
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
You get the same thing with even this:
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.The text was updated successfully, but these errors were encountered: