◐ Shell
clean mode source ↗

Message 86344 - Python tracker

> Maybe if you explicitly ask for the "sign" of a NaN, it should
> always be a space.

Actually, I think '+nan' for format(float('nan'), '+'), and ' nan'
for format(float('nan'), ' ').  Then nans and infs can be treated 
identically, except that the sign of a nan is always considered to be 
positive, regardless of what the _Py_dg_dtoa function returns.

> And when requesting leading zeros, you also get leading spaces
> instead?

Should do the same thing for nans and infs here.  But certainly leading 
zeros should be avoided.  Leading spaces sounds fine to me.