Skip to content

Commit be521aa

Browse files
author
Christopher Doris
committed
juliacall.ArrayValue.__array__ now takes dtype argument
1 parent 706f81f commit be521aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/jlwrap/array.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ function init_jlwrap_array()
314314
@property
315315
def __array_interface__(self):
316316
return self._jl_callmethod($(pyjl_methodnum(pyjlarray_array_interface)))
317-
def __array__(self):
317+
def __array__(self, dtype=None):
318318
# convert to an array-like object
319319
arr = self
320320
if not (hasattr(arr, "__array_interface__") or hasattr(arr, "__array_struct__")):
@@ -326,7 +326,7 @@ function init_jlwrap_array()
326326
# convert to a numpy array if numpy is available
327327
try:
328328
import numpy
329-
arr = numpy.array(arr)
329+
arr = numpy.array(arr, dtype=dtype)
330330
except ImportError:
331331
pass
332332
return arr

0 commit comments

Comments
 (0)