Message155653
I disagree that this is useful enough to make it worth adding to the standard library. Between math.copysign and simple comparisons, I think all the common cases are well covered. And it's a simple one-line function:
def signum(x):
return (x > 0) - (x < 0)
Frank, do you have any convincing use-cases that aren't already covered by math.copysign or simple two-way comparisons (e.g., x >= 0)? |
|
Date |
User |
Action |
Args |
2012-03-13 19:44:36 | mark.dickinson | set | recipients:
+ mark.dickinson, rhettinger, gekonntde, valhallasw, fkbreitl |
2012-03-13 19:44:36 | mark.dickinson | set | messageid: <1331667876.16.0.596359387873.issue829370@psf.upfronthosting.co.za> |
2012-03-13 19:44:35 | mark.dickinson | link | issue829370 messages |
2012-03-13 19:44:35 | mark.dickinson | create | |
|