[Numpy-discussion] ufunc overrides

Blake Griffith blake.a.griffith at gmail.com
Wed Jul 10 23:29:05 EDT 2013

Hello NumPy,

Part of my GSoC is compatibility with SciPy's sparse matrices and NumPy's
ufuncs. Currently there is no feasible way to do this without changing
ufuncs a bit.

I've been considering a mechanism to override ufuncs based on checking the
ufuncs arguments for a __ufunc_override__ attribute. Then handing off the
operation to a function specified by that attribute. I prototyped this in
python and did a demo in a blog post here:
This is similar to a previously discussed, but never implemented change:

However it seems like the ufunc machinery might be ripped out and replaced
with a true multi-method implementation soon. See Travis' blog post:
So I'd like to make my changes as forward compatible as possible. However
I'm not sure what I should even consider here, or how forward compatible my
current implementation is. Thoughts?

Until then, I'm writing up a nep, it is still pretty incomplete, it can be
found here:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130710/3b213089/attachment.html>

More information about the NumPy-Discussion mailing list