We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 706f81f commit be521aaCopy full SHA for be521aa
src/jlwrap/array.jl
@@ -314,7 +314,7 @@ function init_jlwrap_array()
314
@property
315
def __array_interface__(self):
316
return self._jl_callmethod($(pyjl_methodnum(pyjlarray_array_interface)))
317
- def __array__(self):
+ def __array__(self, dtype=None):
318
# convert to an array-like object
319
arr = self
320
if not (hasattr(arr, "__array_interface__") or hasattr(arr, "__array_struct__")):
@@ -326,7 +326,7 @@ function init_jlwrap_array()
326
# convert to a numpy array if numpy is available
327
try:
328
import numpy
329
- arr = numpy.array(arr)
+ arr = numpy.array(arr, dtype=dtype)
330
except ImportError:
331
pass
332
return arr
0 commit comments