signum() not in math?

Dinu Gherman gherman at darwin.in-berlin.de
Fri Oct 12 05:27:16 EDT 2001


Hi!

Time for a periodic frenzy about the standard lib again... ;-)
How comes there is no sign() or signum() function in math?

I found only one thread in comp.lang.python mentioning such
a function that dates back to January 1999, after looking in
Google.groups for "signum -signal -Signum\.se". There, Tim
mentioned a fancy (of course) short signum one-liner...

The question is: why isn't sign() in the math module (or, may-
be built-in)? Is it too trivial? I'm inclined to claim no more 
so than, say, abs(). Maybe a hidden deeply convoluted argument 
about rounding effects? Curious to see that. A way to distin-
guish one's camp from the Perlies'? Strange idea. Nobody nee-
ding it? Surprising. Ahh, a missing PEP, even? That could be
the case... ;-)

Waiting-for-the-Snake-Oracle's-advice'ly,

Dinu

-- 
Dinu C. Gherman
ReportLab Consultant - http://www.reportlab.com
................................................................
"The world becomes a better place as a result of the refusal
to bend to authority and doctrine." (Noam Chomsky)



More information about the Python-list mailing list