You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many NumPy APIs currently have return type Any. view, item, finfo... But almost always, their type arguments are literals ('d', np.float64, for example). We should implement basic dependent types with Python 3.8 literal types in the typing module.
Not sure what you mean here-ndarray.view does not have an Any return type in the types currently. For ndarray.item, it can return anything, i.e.
>>> class A: pass
...
>>> np.array([A()]).item()
<__main__.A object at 0x105ee6ed0>
The fix there is to make ndarray generic over the dtype, which is currently in progress. For finfo, nobody has added types yet; we have #16546 to track that.
Right, so what you're talking about here boils down to DTypeLike being (in practice) unable to accept arbitrary strings.
While aforementioned annotation should eventually be refined with Literals,
there is already substantially sized todo-list (see the previously linked issue) with, as of yet, untyped functions.
Many NumPy APIs currently have return type
Any
.view
,item
,finfo
... But almost always, their type arguments are literals ('d'
,np.float64
, for example). We should implement basic dependent types with Python 3.8 literal types in the typing module.See also: https://www.python.org/dev/peps/pep-0586/
The text was updated successfully, but these errors were encountered: