Type hint for NumPy ndarray dtype?

后端 未结 4 1430
旧时难觅i
旧时难觅i 2020-12-10 03:44

I would like a function to include a type hint for NumPy ndarray\'s alongside with its dtype.

With lists, for example, one could do the fol

4条回答
  •  旧时难觅i
    2020-12-10 03:59

    To the best of my knowledge it's not possible yet to specify dtype in numpy array type hints in function signatures. It is planned to be implemented at some point in the future. See numpy GitHub issue #7370 and numpy-stubs GitHub for more details on the current development status.

提交回复
热议问题