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.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com