[Python-Dev] Replacement for print in Python 3.0 (original) (raw)
tanzer@swing.co.at tanzer at swing.co.at
Tue Sep 6 08:33:31 CEST 2005
- Previous message: [Python-Dev] Replacement for print in Python 3.0
- Next message: [Python-Dev] string.Template format enhancements (Re: Replacement for print in Python 3.0)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Guido van Rossum <guido at python.org> wrote:
What do you think of the trick (that I wasn't aware of before) used in Java and .net of putting an optional position specifier in the format, and using positional arguments? It would be a little less verbose and with sensible defaults wouldn't quite punish everybody as much for the needs of i18n. Formats with more than 3 or 4 variables should be rare in any case (these are not the days of Fortran formatted output).
Positional arguments remove too much meaning from the template.
Compare:
'$user forgot to frobnicate the $file!\n'
with
'$1 forgot to frobnicate the $2!\n'
Whenever the template definition and its use are not directly adjacent, the template is that much harder to understand (i.e., in the context of translation, one wouldn't see the arguments passed to the template).
Christian Tanzer http://www.c-tanzer.at/
- Previous message: [Python-Dev] Replacement for print in Python 3.0
- Next message: [Python-Dev] string.Template format enhancements (Re: Replacement for print in Python 3.0)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]