[SciPy-Dev] Static Typing

Tyler Reddy tyler.je.reddy at gmail.com
Mon Jun 28 17:48:58 EDT 2021


I'm probably -0.5; I've been merging PRs from Bas and others that add the
typing on the assumption that folks want it, and because it has found a few
bugs.

But I am definitely not a fan of how it makes the code look when I'm
working in i.e., vim, to say the least. And some of the Cython stub files
are an absolute mess to read.
A clean separation between dynamic Python glue code and statically typed
C/C++ would be preferable in my opinion but then you can argue that the glue
basically is the code these days. Another view I've seen expressed is that
adding type hints merely provides an "illusion of productivity;" while
that's a bit
harsh, I do see where it is coming from compared to other priorities.

There's a bit of an assumption that we'd be left behind if we don't add the
type hints, and maybe someday auto-transpiling or whatever will start to
happen
more seriously and then the code is just slower. And/or we slowly get
dropped/forked whatever by all the frameworks that need us to provide type
hints
to check for bugs in massive machine learning workflows and so on. So, I'd
love to be grumpy and not put them in, but I'm afraid it may be a path
to getting left behind.



On Mon, 28 Jun 2021 at 09:13, Pamphile Roy <roy.pamphile at gmail.com> wrote:

> Hi everyone,
>
> In a recent PR (https://github.com/scipy/scipy/pull/14284), we had a
> discussion about static typing.
> My understanding from previous PRs, the inclusion of MyPy in the CI and
> discussions during our last community meetups, was that we wanted
> to gradually start adding type annotations in our code base. Thanks to the
> great help of Bas van Beek and others, we have a few common bricks we can
> use to ease the process.
>
> What is your opinion about adding annotations?
>
> I expressed my position in the issue. TL;DR I am in favour of adding type
> annotations. This greatly helps anyone using an IDE and downstream
> libraries like SciKit-Learn are basically waiting for us.
> Lastly, I am putting here again the link to the last Python Community
> survey https://www.jetbrains.com/lp/python-developers-survey-2020/,
> static typing is the most wanted feature.
>
> Cheers,
> Pamphile
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at python.org
> https://mail.python.org/mailman/listinfo/scipy-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/scipy-dev/attachments/20210628/7df349a0/attachment.html>


More information about the SciPy-Dev mailing list