-
Notifications
You must be signed in to change notification settings - Fork 23k
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' are reserved keywords in python 3.7 #25578
Comments
Good point, although that version is not officially supported yet, it's good to check for possible problems. @mart-e who can handle this? |
Are you sure about it? Won't you just be able to use the python def foo(float=42):
.... even if this is a bad idea |
In other versions, using reserved keywords, you redefine its meaning for that context, but no error is raised |
@mart-e def foo(class=42):
.... It's the same with |
@guewen oh right, thanks for the clarification. That will be problematic as changing that would change the signature which may break the compatibility in stable versions. |
@mart-e maybe not the cleanest way but for retro compatibility, you could rename the key argument in the signature plus adding kwargs and then you search if kwargs contains an 'async' key. That way you only work with string for retro compatibility and the issue is on the caller side. |
This comment has been minimized.
This comment has been minimized.
Hello guys, I will take a quote from here
As version 11 of odoo came first than the python3.7, and making workarounds would render odoo useless for others using the original signature of the methods that involved with keywords reservation of Python3.7. In my opinion, it is better to suggest frozen requirement on python version stating it works with 3.6 Edit: Yet I keep my suggestion, Freezing versions of requirements. Regards. |
In python 3.7, async is a reserved keyword. Using it in a method signature produces a syntax error. Replace by an argument async_load and catch the previous calls in a kw for backward compatibility. Log a warning on public methods. The **kw can be removed in v12 and officially deprecate the 'async' parameter. Fixes odoo#25578 Closes odoo#25783
The compatibility to python 3.7 has been fixed in the following commits: Freezing could be an option but is a radical change in the way we ship Odoo. If we can maintain the compatibility with several versions, it is better. |
Continuation of odoo#25783 Part of odoo#25578
According document of 'What’s New In Python 3.7', 'async' are reserved keywords now.
Code in line 105 of 'odoo/addons/base/ir/ir_qweb/assetsbundle.py'
def to_html(self, sep=None, css=True, js=True, debug=False, async=False, url_for=(lambda url: url)):
will throw SyntaxError out if we launch odoo with this update python.
The text was updated successfully, but these errors were encountered: