
Michael Hudson wrote:
...
Well, this is psyco-style code explosion by hand :-) Doesn't sound like fun.
Well, why not write a little script that generates the code, as part of the build process? And maybe making it an option, for those who fear code bloat?
Incidentally, I think it would be goodness if PyCFunctions exposed more info about the arguments they take.
So, there's not a JIT required, but making the patch could be tedious, repetitive and error prone. Macros could possibly help a bit with the repetition and tedium, although not necessarily the error-prone part. :)
It probably wouldn't be seriously hard to write a program writing program for this.
Ah, oh I see, my message is redundant. I'd like to encourage this.
sending it anyway, it's to bad about all the fine characters -- chris
p.s.: I believe some automatic source analysis and rewrite might pay off in other areas as well. Grepping through the sources, there are still very many similar patterns of PyArg_ParseTupleXXX calls, which could be replaced by less general, optimized versions. This would even *not* cause code bloat, since all those calling sequences would be smaller than now.