[Numpy-discussion] Custom __array_interface__ error
njs at pobox.com
Fri Mar 13 14:43:36 EDT 2015
On Mar 13, 2015 7:22 AM, "Daniel Smith" <dgasmith at icloud.com> wrote:
> Greetings everyone,
> I have a new project that deals with core and disk tensors wrapped into a
single object so that the expressions are transparent to the user after the
tensor is formed. I would like to add __array_interface__ to the core
tensor and provide a reasonable error message if someone tries to call the
__array_interface__ for a disk tensor. I may be missing something, but I do
not see an obvious way to do this in the python layer.
Just define your class so that attempting to access __array_interface__
raises an error directly:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion