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

Brett Cannon brett at python.org
Wed Feb 5 17:25:07 CET 2014


On Wed, Feb 5, 2014 at 11:04 AM, Georg Brandl <g.brandl at gmx.net> wrote:

> Am 05.02.2014 14:52, schrieb "Martin v. Löwis":
> > Am 03.02.14 15:43, schrieb Larry Hastings:
> >> A: We create a PyMethodDefEx structure with an extra field: "const char
> >> *signature".  We add a new METH_SIGNATURE (maybe just METH_SIG?) flag to
> >> the flags, indicating that this is an extended structure.  When
> >> iterating over the PyMethodDefs, we know how far to advance the pointer
> >> based on this flag.
> >>
> >> B: Same as A, but we add three unused pointers (void *reserved1 etc) to
> >> PyMethodDefEx to give us some room to grow.
> >>
> >> C: Same as A, but we add two fields to PyMethodDefEx.  The second new
> >> field identifies the "version" of the structure, telling us its size
> >> somehow.  Like the lStructSize field of the OPENFILENAME structure in
> >> Win32.  I suspect YAGNI.
> >
> > D: Add a new type slot for method signatures. This would be a
> > tp_signature field, along with a new slot id Py_tp_signature. The
> > signature field itself could be
> >
> > struct PyMethodSignature {
> >    char *method_name;
> >    char *method_signature;
> > };
>
> Mostly unrelated question while seeing the "char *" here: do we (or do we
> want to) support non-ASCII names for functions implemented in C?
>

Extension modules names being non-ASCII being discussed in
http://bugs.python.org/issue20485
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140205/71dc7623/attachment.html>


More information about the Python-Dev mailing list