We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ec6639 commit 71a8edbCopy full SHA for 71a8edb
1 file changed
jmespath/functions.py
@@ -37,7 +37,9 @@
37
38
39
def is_array(arg):
40
- return hasattr(arg, "__array__") and arg.shape != ()
+ # Is trivially convertible to a non-scalar ndarray via array method. see:
41
+ # https://numpy.org/doc/stable/user/basics.interoperability.html#the-array-method
42
+ return hasattr(arg, "__array__") and arg.__array__().shape != ()
43
44
45
def is_arraylike(arg):
0 commit comments