Issue 20456: Argument Clinic rollup patch, 2014/01/31 (original) (raw)

Probably the last rollup patch for a while; I need to move on to code reviewing.

Here's a list of changes in this patch:

And last but certainly not least...!

Following a suggestion by Serhiy Storchaka, Argument Clinic is now incredibly sophisticated with respect to #if'd out code. In less than 200 lines, I wrote a reasonable C preprocessor monitor class. The monitor parses C files in parallel to Argument Clinic. At any time you can ask the monitor "what's the current preprocessor conditional state?" If the current code is potentially if'd out, Argument Clinic uses the same conditional to potentially #if out the parser function, the docstring, etc, when writing those to buffer or file. It even adds this to the end:

#ifndef YOUR_FUNCTION_METHODDEF #define YOUR_FUNCTION_METHODDEF #endif /* !defined(YOUR_FUNCTION_METHODDEF) */

But only when necessary.

You can see this in action in the diff for Modules/clinic/zlibmodule.c.h.

I think this is a huge improvement! (Thanks for the suggestion, Serhiy!)

Updated the patch.