Created on 2016-02-08 11:08 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Messages (8) |
|
|
msg259836 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-02-08 11:07 |
Proposed patch makes Argument Clinic to generate C code with curly braces as strongly preferred by PEP 7. |
|
|
msg259837 - (view) |
Author: Martin Panter (martin.panter) *  |
Date: 2016-02-08 11:33 |
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. |
|
|
msg264597 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-05-01 13:59 |
The only thing that disturbs me is that some templates need duplicating braces, and others need quadrupling braces. |
|
|
msg264598 - (view) |
Author: Meador Inge (meador.inge) *  |
Date: 2016-05-01 14:24 |
LGTM. I agree that the extra braces are a little gross, but nothing immediately comes to mind as how to make that better. |
|
|
msg264603 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-05-01 17:37 |
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. |
|
|
msg264628 - (view) |
Author: Larry Hastings (larry) *  |
Date: 2016-05-02 06:40 |
I'm not excited by this new addition to PEP 7, so I'm excusing myself from this issue. |
|
|
msg264632 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-05-02 09:08 |
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. |
|
|
msg268024 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-06-09 13:17 |
New changeset eeb742d8bf9c by Serhiy Storchaka in branch '3.5': Issue #26305: Argument Clinic now escapes braces. No need to double them. https://hg.python.org/cpython/rev/eeb742d8bf9c New changeset d983c313b8f1 by Serhiy Storchaka in branch 'default': Issue #26305: Argument Clinic now escapes braces. No need to double them. https://hg.python.org/cpython/rev/d983c313b8f1 New changeset 2d7dcd8cf928 by Serhiy Storchaka in branch 'default': Issue #26305: Argument Clinic now uses braces in C code as required by PEP 7. https://hg.python.org/cpython/rev/2d7dcd8cf928 |
|
|
History |
|
|
|
Date |
User |
Action |
Args |
2022-04-11 14:58:27 |
admin |
set |
github: 70493 |
2016-06-09 13🔞07 |
serhiy.storchaka |
set |
status: open -> closedresolution: fixedstage: patch review -> resolved |
2016-06-09 13:17:24 |
python-dev |
set |
nosy: + python-devmessages: + |
2016-06-09 12:28:50 |
serhiy.storchaka |
set |
assignee: serhiy.storchaka |
2016-05-02 09:08:51 |
serhiy.storchaka |
set |
files: + clinic_escape_braces.patchmessages: + |
2016-05-02 06:40:58 |
larry |
set |
nosy:brett.cannon, larry, meador.inge, martin.panter, serhiy.storchakamessages: + |
2016-05-01 18:49:00 |
serhiy.storchaka |
link |
issue23867 dependencies |
2016-05-01 17:38:13 |
serhiy.storchaka |
set |
files: + clinic_pep7_braces2.patchmessages: + |
2016-05-01 14:24:46 |
meador.inge |
set |
nosy: + meador.ingemessages: + |
2016-05-01 13:59:22 |
serhiy.storchaka |
set |
messages: + |
2016-02-08 11:33:32 |
martin.panter |
set |
nosy: + martin.pantermessages: + |
2016-02-08 11:08:58 |
serhiy.storchaka |
set |
components: + Argument Clinic |
2016-02-08 11:08:31 |
serhiy.storchaka |
create |
|