On Wed, 24 Mar 2021 at 23:08, Stefan Behnel <stefan...@behnel.de> wrote:

> Hi,
>
>
Hi Stefan,


> I'll prepare a new 3.0 alpha release during the next days. If you have or
> know anything that is ready for inclusion that I should take a look at,
> please send me a quick note.
>
>
Years, ago, I contributed some bits of what today is the autodoc transform
(#cython: embedsignature=True).
I have a reimplementation of this transform for use within mpi4py
https://github.com/mpi4py/mpi4py/blob/master/conf/cyautodoc.py
The main feature of this reimplementation is to render types using
annotation typing.
The  purpose is twofold: the signatures in docstrings look much better, and
they are also good enough to generate typing stuff by simply copying over
the signature Cython generates.
So, I have this ad hoc script that extracts signatures from the first
docstring line and generates *.pyi stubs for mpi4py:
https://github.com/mpi4py/mpi4py/blob/master/conf/mpistubgen.py
The ah hoc stubgen script generates the following MPI.pyi stub file:
https://github.com/mpi4py/mpi4py/blob/master/src/mpi4py/MPI.pyi
I insist: all the signatures you see in that MPI.pyi stub file is a
verbatim copy of the first line of docstrigns Cython generates with the
reimplemented transform.

Do you think it would be worth pushing this reimplementation to Cython
to have it available in the upcoming 3.0?
The main and perhaps only drawback is that the output is not backward
compatible with the previous output.
But IMHO the new output looks way better and it is totally in line with the
new trend of using annotations and typing.

PS: I should have raised this proposal earlier, but I've been quite busy,
sorry about that.


-- 
Lisandro Dalcin
============
Senior Research Scientist
Extreme Computing Research Center (ECRC)
King Abdullah University of Science and Technology (KAUST)
http://ecrc.kaust.edu.sa/
_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel

Reply via email to