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
Make Argument Clinic to generate PEP 7 conforming code #70493
Comments
Proposed patch makes Argument Clinic to generate C code with curly braces as strongly preferred by PEP-7. |
FWIW I agree with this change. I left one review comment. I presume the important stuff is just in Tools/clinic/clinic.py and the other changes are all generated code. |
The only thing that disturbs me is that some templates need duplicating braces, and others need quadrupling braces. |
LGTM. I agree that the extra braces are a little gross, but nothing immediately comes to mind as how to make that better. |
The problem was that I didn't know wherever all braces repeated correct times. Actually they were not used correctly in NoneType_return_converter, but since this converter is not used in current sources, this error left unnoticed. New patch escapes generated strings that can contain braces before substituting them in the template for format(). This allows to decrease the braces repetition number to minimal value. Now there is no need to quadruple them. |
I'm not excited by this new addition to PEP-7, so I'm excusing myself from this issue. |
Here is a patch for 3.5 that allows to not repeat braces too much. This will help to backport new fixes to 3.5. |
New changeset eeb742d8bf9c by Serhiy Storchaka in branch '3.5': New changeset d983c313b8f1 by Serhiy Storchaka in branch 'default': New changeset 2d7dcd8cf928 by Serhiy Storchaka in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: