[Lie Ryan]
> A hyphotetical code using conv function and the microlanguage could look
> like this:
>
>  >>> num = 213210.3242
>  >>> fmt = create_format(sep='-', decsep='@')
>  >>> print fmt
> 50|\/|3_v3ry_R34D4|3L3_C0D3
>  >>> '{0!{1}}'.format(num, fmt)
> '213-...@3242'

LOL, it's like APL all over again ;-)

FWIW, the latest version of the proposal is dirt simple:

>>> format(1234567, 'd')       # what we have now
'1234567'
>>> format(1234567, ',d')      # proposed new option
'1,234,567'
>>> format(1234.5, '.2f')      # what we have now
'1234.50'
>>> format(1234.5, ',.2f')     # proposed new option
'1,234.50'


The proposal is roughly:
  If you want commas in the output,
  put a comma in the format string.
It's not rocket science.

What is rocket science is what you have to do now
to achieve the same effect.  If someone finds the
above to be baffling, how the heck are they going
to do the same thing using the locale module?


Raymond
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to