This repository was archived by the owner on Jun 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -479,6 +479,12 @@ def array(
479
479
subok : bool = ...,
480
480
ndmin : int = ...,
481
481
) -> ndarray : ...
482
+ def zeros (
483
+ shape : _ShapeLike , dtype : _DtypeLike = ..., order : Optional [str ] = ...
484
+ ) -> ndarray : ...
485
+ def ones (
486
+ shape : _ShapeLike , dtype : _DtypeLike = ..., order : Optional [str ] = ...
487
+ ) -> ndarray : ...
482
488
483
489
# TODO(shoyer): remove when the full numpy namespace is defined
484
490
def __getattr__ (name : str ) -> Any : ...
Original file line number Diff line number Diff line change
1
+ """Simple expression that should fail with mypy."""
2
+
3
+ import numpy as np
4
+
5
+ # Array creation routines checks
6
+ np .zeros ("test" ) # E: incompatible type
7
+ np .zeros () # E: Too few arguments
8
+
9
+ np .ones ("test" ) # E: incompatible type
10
+ np .ones () # E: Too few arguments
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ def ndarray_func(x):
13
13
array == 1
14
14
array .dtype == float
15
15
16
+ # Array creation routines checks
17
+ ndarray_func (np .zeros ([1 , 2 ]))
18
+ ndarray_func (np .ones ([1 , 2 ]))
19
+
16
20
# Dtype construction
17
21
np .dtype (float )
18
22
np .dtype (np .float64 )
You can’t perform that action at this time.
0 commit comments