File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -88,14 +88,14 @@ def asarray(
8888 """
8989 _helpers ._check_device (np , device )
9090
91+ # None is unsupported in NumPy 1.0, but we can use an internal enum
92+ # False in NumPy 1.0 means None in NumPy 2.0 and in the Array API
9193 if copy is None :
92- np1_copy = np ._CopyMode .IF_NEEDED # type: ignore[attr-defined]
93- elif copy :
94- np1_copy = np ._CopyMode .ALWAYS # type: ignore[attr-defined]
95- else :
96- np1_copy = np ._CopyMode .NEVER # type: ignore[attr-defined]
94+ copy = np ._CopyMode .IF_NEEDED # type: ignore[assignment,attr-defined]
95+ elif copy is False :
96+ copy = np ._CopyMode .NEVER # type: ignore[assignment,attr-defined]
9797
98- return np .array (obj , copy = np1_copy , dtype = dtype , ** kwargs )
98+ return np .array (obj , copy = copy , dtype = dtype , ** kwargs )
9999
100100
101101def astype (
You can’t perform that action at this time.
0 commit comments