Hendrik van Rooyen wrote:
"Ulrich Eckhardt" <eck...aser.com> wrote:

IOW, why not explicitly say what you want using keyword arguments with
defaults instead of inventing an IMHO cryptic, read-only mini-language?
Seriously, the problem I see with this proposal is that its aim to be as
short as possible actually makes the resulting format specifications
unreadable. Could you even guess what "8T.,1f" should mean if you had not
written this?

+1

Look back in history, and see how COBOL did it with the
PICTURE - dead easy and easily understandable.
Compared to that, even the C printf stuff  and python's %
are incomprehensible.

- Hendrik

Seeing how many people complained for the proposal being unreadable (although it tries to be simple by not including too much features), why not go all the way to unreadability and teach people to always use some sort of convenience function and never use the microlanguage except of very simple cases (or extremely complex cases, in which case you might actually be better served with writing your own formatting function).

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'
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to