> Also, can’t get __array_wrap__ to work. The arguments it receives after 
> __iadd__ are all
> post-operation. Decided not to do it this way this time so not to hardcode 
> such functionality
> into the class, but if there is a way to robustly achieve this it would be 
> good to know.

It is non-trivial to clip in the operation, since internally the code
just wraps like C does (actually, I think for some C implementations it
clips...). I think you'd be stuck with evaluating with more bits and
then clipping before casting back (probably easiest by definining your
own __array_ufunc__) -- or writing your own inner loops.

-- Marten

_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to