A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-January/131895.html below:

[Python-Dev] .clinic.c vs .c.clinic

[Python-Dev] .clinic.c vs .c.clinicLarry Hastings larry at hastings.org
Mon Jan 20 22:57:52 CET 2014
On 01/20/2014 01:47 PM, Ethan Furman wrote:
> So, if I understand correctly, by moving into a sidefile approach, we 
> will have go to a two-pass system?  Once to ACify the file and run 
> Argument Clinic on it, and then again to add in the macros?
>
> Is this basically the same as it was with the buffer approach?

Let me paraphrase this to add context, to see if I understand your 
question correctly.

When you add the Argument Clinic blob to a function, Argument Clinic 
generates some C code.  That code contains a parsing function, an "impl" 
function (which you implement), and a macro to paste into the correct 
slot in the PyMethodDef structure.  The name of the macro is 
full_name_of_function.upper() + "_METHODDEF".  However, it can be 
inconvenient to guess what the actual macro name is, so most people fill 
out the structure, run clinic.py on the C file, then go hunting for the 
METHODDEF macro definition to get the name.  This is what you refer to 
as "a two-pass system": edit the file, run Argument Clinic on it, then 
edit it to put the METHODDEF macro in the right spot.

If that's what you meant, then: yes, and yes.  It's possible to skip the 
second pass if you're comfortable guessing the generated name of the 
macro, but that's just one more thing for people to remember, and 
hunting for it is easier.  And yes, whether it's original output or 
buffer or "clinic file" (I'm trying to deprecate the name "side file", 
it was a dumb idea), the destination Argument Clinic writes to doesn't 
dramatically alter what it writes.


//arry/

p.s. Your saying "macros" threw me off, as there's only one macro.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140120/a1997752/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4