Skip to content
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

feat: support for python3.7 (async is a keyword) #8401

Merged
merged 3 commits into from
Sep 26, 2018

Conversation

tomplus
Copy link
Contributor

@tomplus tomplus commented Jul 7, 2018

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

Fix: #8328

In Python 3.7 'async' is a reserved keyword. I replaced async wih async_req in function definitions.

PTAL: @kenjones-cisco

@HugoMario
Copy link
Contributor

cc @frantuma

@kenjones-cisco
Copy link
Contributor

LGTM!
Thanks @tomplus

@joshowen
Copy link

Anything I can help with to get this merged in? Thanks!

@xavierhardy
Copy link

Can you rebase on the master branch please?

def date(self, date):
"""Sets the date of this FormatTest.
@_date.setter
def _date(self, _date):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are trying to avoid a conflict with date, you should put the underscore at the end not at the beginning since it usually means that an argument/method is private (https://docs.python-guide.org/writing/style/#we-are-all-responsible-users). It is also recommended by PEP8: https://www.python.org/dev/peps/pep-0008/#function-and-variable-names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xavierhardy it's not my change. It appears after regenerate this sample client.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/swagger-api/swagger-codegen/pull/7956/files < this introduced the change but without regenerating samples


self._date = date
self.__date = _date

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the double underscore is really necessary here (nor anywhere else).

https://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles
__double_leading_underscore: when naming a class attribute, invokes name mangling (inside class FooBar, __boo becomes _FooBar__boo; see below).

@PeaceInColour
Copy link

Is this PR still expected to be open for a while or will the merge happen soon?

@detonavomek-zz
Copy link

Had the same issue. Could you merge this PR?

@shelling
Copy link

LGTM. Hope it can be merged son

@HugoMario
Copy link
Contributor

thanks a lot !!!

@HugoMario HugoMario merged commit 1f93f09 into swagger-api:master Sep 26, 2018
@MrSaints
Copy link

Any ETA on a release that will include this fix?

@deansg
Copy link

deansg commented Feb 16, 2020

I think that since the name of this issue is "support for python 3.7", it should be noted that there are also other currently unsolved problems with upgrading the python version. The most major one I came across is the following issue related to util.py:
#8921

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.

[Python] "async" is now a reserved keyword in Python 3.7
10 participants