[Numpy-discussion] abs for max negative integers - desired behavior?

Matthew Brett matthew.brett at gmail.com
Tue Oct 18 15:39:09 EDT 2011


Hi,

2011/10/18 Frédéric Bastien <nouiz at nouiz.org>:
> What about a parameter that allow to select the option the user want?
> it would select between uint, upcasted_int, -MAX and +MAX. This way,
> at least it will be documented and user who care will have the choose.
>
> Personally, when the option is available, I would prefer the safe
> version, uint, but I understand that is not all people position.

Would there be any objection to the proposal to add a keyword to abs:

always_positive=False

or similar, which would have the effect, when True, of returning uints
from an int?

Best,

Matthew



More information about the NumPy-Discussion mailing list