The Python Oracle

Type hinting / annotation (PEP 484) for numpy.ndarray

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: A Thousand Exotic Places Looping v001

--

Chapters
00:00 Question
00:40 Accepted answer (Score 67)
03:12 Answer 2 (Score 65)
04:21 Answer 3 (Score 23)
05:13 Answer 4 (Score 8)
05:27 Thank you

--

Full question
https://stackoverflow.com/questions/3567...

Question links:
[numpy.ndarray]: http://docs.scipy.org/doc/numpy/referenc...
[typing.Any]: https://docs.python.org/3/library/typing...
[type alias]: https://docs.python.org/3/library/typing...
[array_like]: http://docs.scipy.org/doc/numpy/user/bas...
[dtype]: http://docs.scipy.org/doc/numpy/referenc...
[ufunc]: http://docs.scipy.org/doc/numpy/referenc...

Accepted answer links:
https://numpy.org/doc/stable/reference/t...
https://github.com/python/typing
https://github.com/numpy/numpy
http://bugs.python.org/

Answer 2 links:
[Numpy 1.21 docs]: https://numpy.org/doc/1.21/reference/typ...
[numpy/numpy#16544]: https://github.com/numpy/numpy/issues/16...

Answer 3 links:
[image]: https://i.stack.imgur.com/PokYL.png

Answer 4 links:
[nptyping]: https://github.com/ramonhagenaars/nptypi...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #python3x #numpy #typehinting #pythontyping

#avk47