question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

“async” is a reserved word in Python 3.7 and greater

See original GitHub issue

Using async as a function parameter is a syntax error in Python >= 3.7. Other modules like PyTouch and Cuda have shifted to using non_blocking instead of async.

flake8 testing of https://github.com/hill-a/stable-baselines on Python 3.7.0

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./stable_baselines/acktr/acktr_cont.py:83:68: E999 SyntaxError: invalid syntax
                               epsilon=1e-2, stats_decay=0.99, async=1, cold_iter=1,
                                                                   ^
./stable_baselines/acktr/value_functions.py:39:40: E999 SyntaxError: invalid syntax
                                   async=1, kfac_update=2, cold_iter=50,
                                       ^
./stable_baselines/acktr/acktr_disc.py:174:87: E999 SyntaxError: invalid syntax
                                                                stats_decay=0.99, async=1, cold_iter=10,
                                                                                      ^
./stable_baselines/acktr/kfac.py:15:74: E999 SyntaxError: invalid syntax
                 full_stats_init=False, cold_iter=100, cold_lr=None, async=False, async_stats=False, epsilon=1e-2,
                                                                         ^
4     E999 SyntaxError: invalid syntax
4

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
hill-acommented, Sep 21, 2018

Hey,

async_ can work, but considering most of the issues are from ACKTR, the async means asynchronous eigen decomposition, might as well call it async_eigen_decomp.

0reactions
araffincommented, Sep 29, 2018

@geeksambhu Unless you already started, I plan to fix that issue tomorrow 😉.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's New In Python 3.7 — Python 3.11.1 documentation
This article explains the new features in Python 3.7, compared to 3.6. Python 3.7 was released on June 27, ... async and await...
Read more >
python - Calling cuda() with async results in SyntaxError
async is a reserved keyword in python which cannot be used in that way, that is why you get the SyntaxError. cuda() no...
Read more >
Asyncio in Python 3.7
Let's dive in. New Reserved Keywords. The async and await keywords are now reserved. This was needed in order to cement the asynchronous ......
Read more >
Python 3.7: Cool New Features for You to Try
The Order of Dictionaries Is Guaranteed; “async” and “await” Are Keywords; “asyncio” Face Lift; Context Variables; Importing Data Files With ...
Read more >
SyntaxError regarding async when attempting to run ...
Yes, the issue is occurring because async was added as a reserved keyword in Python 3.7. When you import pexpect , it's importing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found