[Python-ideas] Why no sign function?

Xavier Ho contact at xavierho.com
Mon Apr 26 23:16:50 CEST 2010


On Tue, Apr 27, 2010 at 7:12 AM, cool-RR <cool-rr at cool-rr.com> wrote:

> This was probably discussed a lot. Why is there no simple `sign` function
> in Python, like in the math module or something? I mean one that tells you
> the sign of a number.
>
>
I really hate to shot you down man. First of all, how are you returning the
sign? True/False for positive or negative? What about zero? Is zero a
positive or a negative number?

Secondly, when you get the output, how are you using it? Comparison -- ah
wait, there is always if x > 0 ...

I think you need to carefully think about these ideas before proposing them.
I feel you're wasting your own time, here.

Cheers,
Xav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20100427/3dd391c0/attachment.html>


More information about the Python-ideas mailing list