Hi Lisandro! :)

Lisandro Dalcin schrieb am 24.03.21 um 21:27:
> On Wed, 24 Mar 2021 at 23:08, Stefan Behnel wrote:
>> 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.

Probably not something for the next alpha, but yes, that would be nice. And
3.0 is the right time to make this change.

Requires a proper PR, though, and a bunch of tests that make sure that what
we generate here is reasonable and correct, especially in the light of
Cython's pure Python type annotations. Also thinking of C++ types here…

Stefan
_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel

Reply via email to