[python-flask] adopt python3.5+ syntax#16375
[python-flask] adopt python3.5+ syntax#16375wing328 merged 3 commits intoOpenAPITools:masterfrom anis-campos:python_flask/remove_python_2
Conversation
|
FYI. I've filed #16321 to add better pydantic support in the python fastapi generator. Do you think python-flask generator also needs similar enhancement (python flask generator does not use pydantic at the moment if I remember correctly) ? |
removing some residual python2 code, since it is not supported anymore, like: - no need for `six` anymore - no need for encoding utf8 in top file - remove `object` inheritance in base model - remove absolute import `__future__`
I'm not a user of pydantic, we generally use marshmallow and dataclasses in our projects, so I can't really tell the pros and cons, but I will look up to it, it may do some good for us. However, I'm not sure that adding support for pydantic in the flask generator at this point is really wise. IMO, I would rather have it in another generator, or alternatively, it should be a choice at generation time, not sure how it would pan out, but it would certainly be a breaking change for those already using it. |
|
thanks for the feedback. we won't add it to the python flask generator for the time being. |
applying the new templates
ignore all the `.venv` folders
|
LGTM. Thanks for the PR. FYI @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @arun-nalla (2019/11) @krjakbrjak (2023/02) |
removing some residual python2 code, since it is not supported anymore, like:
sixanymoreobjectinheritance in base model__future__resolve #16377
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(6.3.0) (minor release - breaking changes with fallbacks),7.0.x(breaking changes without fallbacks)