This repository was archived by the owner on Jun 10, 2020. It is now read-only.
File tree 2 files changed +16
-4
lines changed
2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 8
8
x1 : "np.ArrayLike" = (i for i in range (10 )) # E: Incompatible types in assignment
9
9
x2 : "np.ArrayLike" = A () # E: Incompatible types in assignment
10
10
x3 : "np.ArrayLike" = {1 : "foo" , 2 : "bar" } # E: Incompatible types in assignment
11
+
12
+ scalar = np .int64 (1 )
13
+ scalar .__array__ (dtype = np .float64 ) # E: Unexpected keyword argument
14
+ array = np .array ([1 ])
15
+ array .__array__ (dtype = np .float64 ) # E: Unexpected keyword argument
Original file line number Diff line number Diff line change 15
15
x11 : "np.ArrayLike" = "foo"
16
16
17
17
18
- class B :
18
+ class A :
19
19
def __array__ (self , dtype : Optional ["np.DtypeLike" ] = None ) -> np .ndarray :
20
20
return np .array ([1 , 2 , 3 ])
21
21
22
22
23
- x12 : "np.ArrayLike" = B ()
24
- x13 : "np._SupportsArray" = np .int64 (1 )
25
- x14 : "np._SupportsArray" = np .array (1 )
23
+ x12 : "np.ArrayLike" = A ()
24
+
25
+ scalar : "np._SupportsArray" = np .int64 (1 )
26
+ scalar .__array__ (np .float64 )
27
+ array : "np._SupportsArray" = np .array (1 )
28
+ array .__array__ (np .float64 )
29
+
30
+ a : "np._SupportsArray" = A ()
31
+ a .__array__ (np .int64 )
32
+ a .__array__ (dtype = np .int64 )
26
33
27
34
# Escape hatch for when you mean to make something like an object
28
35
# array.
You can’t perform that action at this time.
0 commit comments