Python And Internationalization maybe a pre-pep?

Brian Kelley bkelley at wi.mit.edu
Mon Jan 12 09:20:30 EST 2004


Neil Hodgson wrote:
> Brian Kelley:
> 
> 
>>I made a new python string type and got enough working on the parser to
>>accept
>>
>>string = i"whatever"
> 
> 
>    I would not like to see strings gain more interpretation prefix
> characters without very strong justification as the combinational growth
> makes code interpretation more difficult. The "i" would need to be used in
> conjunction with the "u" or "U" Unicode prefix and possibly the "r" or "R"
> raw prefix.
> 
>    The order of interpretation here is reasonably obvious as the
> internationalization would be applied after the treatment as Unicode and
> raw. However, when used in conjunction with other proposed prefix characters
> such as for variable interpolation, the ordering becomes more questionable.

If the gettext mechanism is followed, it would make sense that 
i"whatever" would be a special form of unicode so multiple prefixes 
might not be necessary.

That being said, after some of the preceding discussions, I'm not sure 
that introducing a new built-in datatype would be that useful.  I'm 
leaning toward something like:

string = international("whatever")

Which would be a bit more typing but would allow

international(r"whatever")

I think that we've pretty much beaten this topic into the ground though, 
it's time to finish coding up the data type and see how it works.

Thanks for your input.
Brian




More information about the Python-list mailing list