Rough draft: Proposed format specifier for a thousands separator
python at rcn.com
Thu Mar 12 11:56:33 CET 2009
> IOW, why not explicitly say what you want using keyword arguments with
> defaults instead of inventing an IMHO cryptic, read-only mini-language?
That makes sense to me but I don't think that's the way the format()
builtin was implemented (see PEP 3101 which was implemented Py2.6 and
It is a simple pass-through to a __format__ method for each
object. I don't see how keywords would fit in that framework. What
proposed is similar to locale module's existing "n" specifier except
this lets you say exactly what you want instead of deferring to the
The mini-language seems to already be the way of things (just as it is
many other languages including PHP, C, Fortran, and whatnot). I'm
proposing an addition "T," so you add commas as a thousands separator.
More information about the Python-list