This repository was archived by the owner on Jun 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 88x1 : "np.ArrayLike" = (i for i in range (10 )) # E: Incompatible types in assignment
99x2 : "np.ArrayLike" = A () # E: Incompatible types in assignment
1010x3 : "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 1515x11 : "np.ArrayLike" = "foo"
1616
1717
18- class B :
18+ class A :
1919 def __array__ (self , dtype : Optional ["np.DtypeLike" ] = None ) -> np .ndarray :
2020 return np .array ([1 , 2 , 3 ])
2121
2222
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"
31+ a .__array__ (np .int64 )
32+ a .__array__ (dtype = np .int64 )
2633
2734# Escape hatch for when you mean to make something like an object
2835# array.
You can’t perform that action at this time.
0 commit comments