Re: [Python-Dev] string formatting and i18n

2005-09-05 Thread Antoine Pitrou
Le lundi 05 septembre 2005 à 16:52 +0100, Gareth McCaughan a écrit : ... and should add: Of course it's usually seen as being about output more than about formatting, but in fact if you want to do what Python does with %, C with sprintf and Common Lisp with (format nil ...) then the Right

Re: [Python-Dev] string formatting and i18n

2005-09-05 Thread Barry Warsaw
On Mon, 2005-09-05 at 12:07, Antoine Pitrou wrote: Uh, what about internationalization (i18n) ? In i18n you can't avoid the need for parameterized strings. For example I want to write : _(The file '%s' is read only) % filename not : _(The file) + ' + filename + ' + _(is read

Re: [Python-Dev] string formatting and i18n

2005-09-05 Thread Gareth McCaughan
On Monday 2005-09-05 17:07, Antoine Pitrou wrote: Le lundi 05 septembre 2005 à 16:52 +0100, Gareth McCaughan a écrit : ... and should add: Of course it's usually seen as being about output more than about formatting, but in fact if you want to do what Python does with %, C with sprintf and

Re: [Python-Dev] string formatting and i18n

2005-09-05 Thread François Pinard
[Barry Warsaw] Actually, this was part of the motivation behind PEP 292 and Template strings, because what you really want is named parameters, not positional parameters: 'The file $filename in directory $dir is read only' There are a few techniques for getting full i18n for Template

Re: [Python-Dev] string formatting and i18n

2005-09-05 Thread Barry Warsaw
On Mon, 2005-09-05 at 14:10, François Pinard wrote: The file %(filename)s in directory %(dir)s is read only % vars() is already usable. The need being already filled without Template strings, it could hardly be presented as a motivation for them. :-) Except that IME, %(var)s is an