[Numpy-discussion] Type annotations for NumPy

Stephan Hoyer shoyer at gmail.com
Tue Dec 5 13:04:54 EST 2017


This discussion has died down, but I don't want to lose momentum .

It sounds like there is at least strong interest from a subset of our
community in type annotations. Are there any objections to the first part
of my plan, to start developing type stubs for NumPy in separate repository?

We'll come back to the mailing list when we have concrete proposals for
typing dtypes and shapes.

On Tue, Nov 28, 2017 at 4:05 PM Chris Barker - NOAA Federal <
chris.barker at noaa.gov> wrote:

>
>
> (a) it would be good if NumPy type annotations could include an
> “array_like” type that allows lists, tuples, etc.
>
>
> I think that would be a sequence — already supported by the Typing system.
>
> (b) I’ve always thought (since PEP561) that it would be cool for type
> annotations to replace compiler type annotations for e.g. Cython and Numba.
> Is this in the realm of possibility for the future?
>
>
> Well, this was brought up early in the Typing discussion, and it was made
> clear that these kinds of truly static types, as needed by Cython, was a
> non-goal of the project.
>
> That being said, perhaps it could be made to work with a bunch of
> additional type objects.
>
> And we should lol lol to Cython for ideas about how to type numpy arrays.
>
> One note: in addition to shape (rank) and types, there is contiguous and C
> or F order. That may want to be considered.
>
> -CHB
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20171205/6261e39c/attachment.html>


More information about the NumPy-Discussion mailing list