Thanks to visit codestin.com
Credit goes to github.com

Skip to content

core: handle both "async" and "asynchronous" in remote calls #245

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

Merged
merged 1 commit into from
Jan 5, 2022

Conversation

chombourger
Copy link
Contributor

Python 3.7 made "async" a reserved keyword: this causes a syntax
error when passing "async" as a named parameter in remote procedure
calls. Make ClientBase.call() understand both "async" and
"asynchronous" so we don't break our binary interface with older
clients.

Fixes: #239
Signed-off-by: Cedric Hombourger [email protected]

@bombela
Copy link
Member

bombela commented Jan 5, 2022

You can always pass **{"async": True}.

What not name the new argument "async_". And also add it to the named argument list directly. This helps for type checking and other linting tools.

Python 3.7 made "async" a reserved keyword: this causes a syntax
error when passing "async" as a named parameter in remote procedure
calls. Make ClientBase.__call__() understand both "async" and
"async_" so we don't break our binary interface with older clients.

Fixes: 0rpc#239
Signed-off-by: Cedric Hombourger <[email protected]>
@chombourger
Copy link
Contributor Author

You can always pass **{"async": True}.

What not name the new argument "async_". And also add it to the named argument list directly. This helps for type checking and other linting tools.

renamed asynchronous to async_ as you recommended. I am however not sure what you meant by "add it to the named argument list directly" as __call__ does not take a named argument list. Am I missing something?

@bombela
Copy link
Member

bombela commented Jan 5, 2022

You are absolutely correct. The function is clearly not taking explicit parameters. Let's not change that.

@bombela bombela merged commit 6e21cd2 into 0rpc:master Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.6.3: pytest is failing in tests/test_client_async.py
2 participants