[Python-Dev] The docstring hack for signature information has to go

Larry Hastings larry at hastings.org
Tue Feb 4 10:59:29 CET 2014


On 02/03/2014 02:06 PM, Gregory P. Smith wrote:
> Wouldn't your proposal to extend the PyMethodDef structure would 
> require ifdef's and make it impossible to include the type information 
> in something compiled against the 3.3 headers that you want to use in 
> 3.4 without recompiling?

It might use #ifdefs.  However, my proposal was forwards-compatible.  
When iterating over the methoddef array passed in with a type, if the 
PyMethodDef flags parameter had METH_SIGNATURE set, I'd advance by 
sizeof(PyMethodDefEx) bytes, otherwise I'd advance by 
sizeof(PyMethodDef) bytes.  Modules compiled against 3.3 would not have 
the flag set, therefore I'd advance by the right amount, therefore they 
should be fine.


//arry/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140204/52c2cee1/attachment-0001.html>


More information about the Python-Dev mailing list