[Python-Dev] Proposing "Argument Clinic", a new way of specifying arguments to builtins for CPython

Larry Hastings larry at hastings.org
Tue Dec 4 23:17:09 CET 2012


On 12/04/2012 01:49 PM, Chris Angelico wrote:
> One thing I'm not entirely clear on. Do you run Clinic on a source
> file and it edits that file, or is it a step in the build process?
> Your description of a preprocessor makes me think the latter, but the
> style of code (eg the checksum) suggests the former.

You run Clinic on a source file and it edits that file in-place (unless 
you use -o).  It's not currently integrated into the build process.  At 
what time Clinic gets run--manually or automatically--is TBD.

Here's my blue-sky probably-overengineered proposal: we (and when I say 
"we" I mean "I") write a cross-platform C program that could be 
harmlessly but usefully integrated into the build process.  First, we 
add a checksum for the *input* into the Clinic output.  Next, when you 
run this program, you give it a C file as an argument. First it tries to 
find a working Python on your path.  If it finds one, it uses that 
Python to run Clinic on the file, propagating any error code outward.  
If it doesn't find one, it understands enough of the Clinic format to 
scan the C file looking for Clinic blocks. If it finds one where the 
checksum doesn't match (for input or output!) it complains loudly and 
exits with an error code, hopefully bringing the build to a screeching 
halt.  This would integrate Clinic into the build process without making 
the build reliant on having a Python interpreter available.

I get the sneaking suspicion that I'm going to rewrite Clinic to run 
under either Python 2.7 or 3,


//arry/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20121204/4c89baef/attachment.html>


More information about the Python-Dev mailing list