[Python-Dev] Generate all Argument Clinic code into separate files

Nick Coghlan ncoghlan at gmail.com
Sun Feb 22 04:03:43 CET 2015


On 22 February 2015 at 06:58, Brett Cannon <brett at python.org> wrote:
>
>
> On Sat Feb 21 2015 at 1:50:32 PM Serhiy Storchaka <storchaka at gmail.com>
> wrote:
>>
>> Currently for some files converted to use Argument Clinic the generated
>> code is written into a separate file, for other files it is inlined.
>>
>> I'm going to make a number of small enhancement to Argument Clinic to
>> generate faster code for parsing arguments (see for example issue23492).
>> Every such step will produce large diffs for
>> generated code and will create code churn if it is inlined and mixed up
>> with handwritten code. It would be better when only generated files will
>> be changed. So I suggest to move all inlined generated code in separate
>> file. What are you think?
>
>
> +1 to moving to a separate file for all .c files. Might be painful now but
> the long-terms benefits are worth it.

Yeah, agreed. Originally I was a fan of having everything inline so I
could see them while I was working on the code, but I eventually
changed my mind to favour making it a clearer build step with a
separate generated file. I suspect it was a matter of starting to
trust AC to do the right thing, so having it implicitly asking me to
check its work all the time ultimately become annoying rather than
reassuring :)

I assume some parts, like the header for the implementation function,
will always need to be generated inline in the hand-edited
implementation file, though.

Regards,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list