Incorporated correction luke suggested

This commit is contained in:
Ognyan Moore 2019-11-21 08:46:25 -08:00
parent 770ce06dc1
commit ef4ca9e9ea

View File

@ -357,9 +357,12 @@ class MetaArray(object):
else:
return np.array(self._data)
def __array__(self):
def __array__(self, dtype=None):
## supports np.array(metaarray_instance)
return self.asarray()
if dtype is None:
return self.asarray()
else:
return self.asarray().astype(dtype)
def view(self, typ):
## deprecated; kept for backward compatibility