[Python-Dev] Re: PEP 292, Simpler String Substitutions

Christian Tismer tismer@tismer.com
Sun, 23 Jun 2002 21:24:16 +0200


Paul Prescod wrote:
> Christian Tismer wrote:
> 
>>...
>>
>>Ok, I'm all with it.
>>Since a couple of hours, I'm riding the following horse:
>>
>>- $name, $(name), $(any expr)  is just fine
>>- all of this is compile-time stuff
>>....
> 
> 
> I think you just described PEP 215. But what you're missing is that we
> need a compile time facility for its flexibility and simplicity but we
> also need a runtime facility to allow I18N.

Are you sure you got what I meant?
I want to compile the variable references away at compile
time, resulting in an ordinary format string.
This string is wraped by the runtime _(), and
the result is then interpolated with a dict.

>>I also believe it is a good idea to do the _() on
>>the unexpanded string (as shown), since the submitted
>>values are most probably hard to translate at all.
> 
> 
> _ runs at runtime. If the interpolation is done at compile time then "_"
> is executed too late.

Compile time does no interpolation but a translation
of the string into a different one, which is interpolated
at runtime.

will-read-PEP215-anyway - chris

-- 
Christian Tismer             :^)   <mailto:tismer@tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34  home +49 30 802 86 56  pager +49 173 24 18 776
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/