[Python-Dev] Replacement for print in Python 3.0
Stephen J. Turnbull
stephen at xemacs.org
Thu Sep 8 18:38:56 CEST 2005
>>>>> "Antoine" == Antoine Pitrou <solipsis at pitrou.net> writes:
Antoine> Le jeudi 08 septembre 2005 à 19:12 +0900, Stephen
Antoine> J. Turnbull a écrit :
>> It would be nice to be able to lose the "_()" calls to
>> gettext(). The function would look to see if a message catalog
>> was available for the current output stream, and if not, do no
I should have been more explicit. I meant only in the context of
printf. You're right, gettext (and aliases) are still needed.
Antoine> That doesn't sound right to me. 1. You still need to do
Antoine> automatic extraction of these strings (gettext has tools
Antoine> for that, which rely on the use of the "_()" function -
Antoine> or any other dedicated function (*)).
I think printf is an excellent candidate for such a function.
Antoine> 2. You can't assume that all strings must be i18n'ed.
IMO strings that are being printf'd can probably be assumed to be
human readable, and therefore candidates for translation. This
assumption does impose runtime overhead on non-i18n users, but I
suspect it's smaller than that of caching regexps which has been
determined to be acceptable.<wink> It would also make printf more
hazardous for use in implementing protocol messages, but I think
that's already pretty hazardous with the print statement.
Although Guido has been very firm about not imposing overhead on _all_
users for the sake of i18n, implementing protocols is a similar
minority activity, and there might be an acceptable tradeoff there.
Antoine> As I said Python needs an operator or function that does
Antoine> string formatting using a simple template, *without*
Antoine> doing output at the same time. The current syntax is the
Antoine> '%' operator, it could change, but it shouldn't be
Antoine> removed in favor of an inflexible print-with-formatting
AFAICT, that is the consensus view. Is there something concrete
you're worried about here?
School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.
More information about the Python-Dev