[Numpy-discussion] Deprecated ufuncs

Charles R Harris charlesr.harris@gmail....
Fri Jun 20 22:21:04 CDT 2008


What should we do about this:

DeprecationWarning: complex divmod(), // and % are deprecated


Note that these functions are not defined in numpy, rather complex numbers
are promoted to python objects and the appropriate method/pyfunction is
called. For fmod this returns an attribute error because this method is not
defined for complex objects. For remainder (which has the same doc string as
fmod), we get the deprecation warning when PyNumber_Remainder is called on
the object. We also get occasional errors and segfaults depending on the
arguments and their order.

I think we have two options: define these functions for ourselves, or remove
them. The latter requires removing objects from the available signatures
because otherwise complex are automatically promoted to the next highest
available type, objects -- a fact that partly accounts for the variety of
promotion rules for ufuncs. The other option is to define them for
ourselves. There is actually a third option, which is not to automatically
promote up the chain of available types until a function is found. I rather
like that myself because it makes explicit the operations available for the
various types and, if we should happen to implement another type, the
function signatures won't change.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080620/0eaa6b37/attachment.html 


More information about the Numpy-discussion mailing list