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(
88
88
"""
89
89
_helpers ._check_device (np , device )
90
90
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
91
93
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]
97
97
98
- return np .array (obj , copy = np1_copy , dtype = dtype , ** kwargs )
98
+ return np .array (obj , copy = copy , dtype = dtype , ** kwargs )
99
99
100
100
101
101
def astype (
You can’t perform that action at this time.
0 commit comments