Discussion:
[Swig-devel] generate type hints for python 3.5+
jelle
2016-01-02 12:48:11 UTC
Permalink
Hi,

With type hints coming to python 3.5 [1], I wonder whether SWIG would be able
to support generating type hints. When wrapping large API's, having type hints
support would make for much stronger IDE support [2], making programming
with the generated SWIG wrappers more robust and fun.

It might make for an interesting feature?

-jelle

[1] https://www.python.org/dev/peps/pep-0484/#stub-files
[2] http://blog.jetbrains.com/pycharm/2015/11/python-3-5-type-hinting-in-pycharm-5/


------------------------------------------------------------------------------
William S Fulton
2016-01-05 22:39:20 UTC
Permalink
Post by jelle
Hi,
With type hints coming to python 3.5 [1], I wonder whether SWIG would be able
to support generating type hints. When wrapping large API's, having type hints
support would make for much stronger IDE support [2], making programming
with the generated SWIG wrappers more robust and fun.
It might make for an interesting feature?
-jelle
[1] https://www.python.org/dev/peps/pep-0484/#stub-files
[2] http://blog.jetbrains.com/pycharm/2015/11/python-3-5-type-hinting-in-pycharm-5/
Hi Jelle

This should be possible. Most of the code for this is already
available and implemented using the "autodoc" feature which adds this
sort of type information into automatically generated docstrings which
a number of IDEs will use if available. It would be an interesting and
probably useful feature, but like everything else with SWIG, there
isn't anyone here hanging around to implement interesting ideas, the
implementation needs to come from someone interested enough to
implement it and supply a patch for review. Hopefully you are that
person!

William

------------------------------------------------------------------------------
Vadim Zeitlin
2016-01-06 11:48:11 UTC
Permalink
On Tue, 5 Jan 2016 22:39:20 +0000 William S Fulton <***@fultondesigns.co.uk> wrote:

WSF> On 2 January 2016 at 12:48, jelle <***@gmail.com> wrote:
WSF> > Hi,
WSF> >
WSF> > With type hints coming to python 3.5 [1], I wonder whether SWIG would be able
WSF> > to support generating type hints. When wrapping large API's, having type hints
WSF> > support would make for much stronger IDE support [2], making programming
WSF> > with the generated SWIG wrappers more robust and fun.
WSF> >
WSF> > It might make for an interesting feature?
WSF> >
WSF> > -jelle
WSF> >
WSF> > [1] https://www.python.org/dev/peps/pep-0484/#stub-files
WSF> > [2] http://blog.jetbrains.com/pycharm/2015/11/python-3-5-type-hinting-in-pycharm-5/
WSF>
WSF> This should be possible. Most of the code for this is already
WSF> available and implemented using the "autodoc" feature which adds this
WSF> sort of type information into automatically generated docstrings which
WSF> a number of IDEs will use if available. It would be an interesting and
WSF> probably useful feature, but like everything else with SWIG, there
WSF> isn't anyone here hanging around to implement interesting ideas, the
WSF> implementation needs to come from someone interested enough to
WSF> implement it and supply a patch for review. Hopefully you are that
WSF> person!

Hello William,

This is another (last?) plea for integrating the doxygen branch before
making these changes as they would certainly result in a lot of conflicts
with the changes done there. I definitely agree that new features are nice,
but it would be great if the already implemented "old" features could be
made part of the official version too.

TIA,
VZ

Loading...