#ifndef MODULE_FUNCTIONNAME_METHODDEF #define MODULE_FUNCTIONNAME_METHODDEF #endif /* !defined(MODULE_FUNCTIONNAME_METHODDEF) */ #/*[python input] #print("def foo(): pass") #[python start generated code]*/ def foo(): pass #/*[python checksum:...]*/ That means the macro always works. If the function is defined, this turns into the correct structure, including the trailing comma. If the function is undefined, this turns into nothing. However, this causes one ticklish problem: where should Argument Clinic put this extra code when using the “block” output preset? It can’t go in the output block, because that could be deactivated by the$_{#ifdef}$ . (That’s the whole point!) In this situation, Argument Clinic writes the extra code to the “buffer” destination. This may mean that you get a complaint from Argument Clinic: Warning in file "Modules/posixmodule.c" on line 12357: Destination buffer 'buffer' not empty at end of file, emptying. When this happens, just open your file, find the dump buffer block that Argument Clinic added to your file (it’ll be at the very bottom), then move it above the$_{PyMethodDef}$ structure where that macro is used. It’s actually possible to use Argument Clinic to preprocess Python files. There’s no point to using Argument Clinic blocks, of course, as the output wouldn’t make any sense to the Python interpreter. But using Argument Clinic to run Python blocks lets you use Python as a Python preprocessor! Since Python comments are different from C comments, Argument Clinic blocks embedded in Python files look slightly different. They look like this: 4.21 Using Argument Clinic in Python files 23