msg207515 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2014-01-07 09:12 |
It will be helpful to add the --clean option for the clinic tool, which removes all Argument Clinic generated code. |
|
|
msg207516 - (view) |
Author: Larry Hastings (larry) *  |
Date: 2014-01-07 09:26 |
When would you want this? |
|
|
msg207524 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2014-01-07 11:36 |
As fast as it is possible. This shouldn't be hard task, Argument Clinic already clean old generated code before inserting new code. |
|
|
msg207525 - (view) |
Author: Larry Hastings (larry) *  |
Date: 2014-01-07 11:38 |
I meant, under what circumstances would you want to use this? I don't know why you would ever want --clean. Removing the output from the Argument Clinic blocks would break any file using it. And Argument Clinic is sufficiently fast, if you were worried about the output being wrong you could just run it again. |
|
|
msg207530 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2014-01-07 13:05 |
This would just make sources more readable and editable. While I read, write or edit code, I don't want generated code distract me. |
|
|
msg207531 - (view) |
Author: Larry Hastings (larry) *  |
Date: 2014-01-07 13:10 |
I don't think Argument Clinic should do this. It would leave the file in a broken state. But if it's an option on clinic.py it might tempt somebody into using it, then they'd be confused. If you want this functionality, please hack it up yourself locally. I wouldn't accept this as a patch. Personally I just got used to the Clinic generated code. |
|
|
msg207544 - (view) |
Author: Larry Hastings (larry) *  |
Date: 2014-01-07 14:58 |
Consider: if you ran "clinic.py --clean" on a C file, then tried to use "make clinic", the makefile would first try to build the C file. But since the C file is now broken, the make would fail. And you can't use "make clinic" to regenerate the Clinic output. Obviously this is fixable, but for someone unfamiliar with Argument Clinic this could be very confusing. |
|
|
msg207559 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2014-01-07 16:52 |
How it differs from the case when you just edit clinic declaration and *_impl function? Until you run clinic on this source file, it is broken. I see that peoples already confused by Argument Clinic and manually edit generated code. |
|
|
msg207563 - (view) |
Author: Larry Hastings (larry) *  |
Date: 2014-01-07 16:58 |
If you edit the Clinic input and don't run clinic.py on it, it's out-of-date but not broken. If you edit the Clinic output and make a mistake, it's *your* fault. If you ran clinic.py --clean, now you've broken your file *and* the normal Clinic build system and you were using the tool correctly. It's the *tool's* fault. I will admit to having very little interest in adding a command-line option called "--clean" that breaks everything. |
|
|
msg207578 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2014-01-07 18:28 |
If you ran clinic.py --clean and then not ran clinic.py without --clean, it's *your* fault. And you will noticed this when run make. I have named this option --clean because it is similar to 'make clean' and 'make distclean'. If you want make automatically call clinic.py, lets 'make clinic' create the .clinic file, 'clinic.py --clean' remove it, and 'make' check if this file exists and run 'make clinic' otherwise. |
|
|
msg207580 - (view) |
Author: Larry Hastings (larry) *  |
Date: 2014-01-07 18:32 |
I must admit I am losing patience with this conversation. Argument Clinic is not going to provide an attractively-named option that breaks your build and requires fixing by hand. The bug is closed, the feature is not happening, it's my hope that we can now move on. |
|
|
msg207932 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2014-01-12 08:10 |
Another use case here is if you want to "check" the remaining call sites of (say) PyArg_ParseTuple that aren't generated by clinic. Call it '--remove' if you want, but the functionality should be useful. |
|
|
msg207953 - (view) |
Author: Larry Hastings (larry) *  |
Date: 2014-01-12 13:29 |
You can accomplish that workflow by using the Clinic buffer prototype and moving all your output to the "side". Or by using the "buffer" approach, and stopping when you hit the generated code. One of these might actually happen in Clinic, too, so hang on to your hats. https://bitbucket.org/larry/python-clinic-buffer |
|
|