[Python-3000] gettext
Barry Warsaw
barry at python.org
Thu May 1 21:15:11 CEST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Apr 30, 2008, at 2:41 PM, Torsten Bronger wrote:
> Indeed. From today's perspective, I see no use case for getting
> human text snippets in byte strings encoded with the same encoding
> that just happened to be used in the .mo file, or with the
> "preferred system encoding".
Agreed.
> So it is only about the question how much hassle a
> renaming/deprecation generates for existing code.
Maybe we shouldn't be so worried about deprecation. Py3 is a clean
break, right?
>> That might argue for renaming ugettext() to gettext() and adding
>> something like a egettext() or bgettext() method.
>
> Okay. But I think its not much advantage to have the "encoded"
> functions under new names, given that instead of renaming, you can
> also easily use ugettext to mimic their behaviour.
Works for me.
>> OTOH, the current names are inspired from GNU gettext so it seems
>> to me there's not much value in renaming our methods, except to
>> increase confusion and break backward compatibility <wink>.
>
> Well, this is hard to evaluate. However, I think that if there is
> no danger of getting silent errors, then the module should switch to
> unicode, possibly even unicode-only. After all, the results of
> gettext are likely to be passed to higher-level functions that use
> (or will switch to) unicode, too.
>
> As for "gettext" returning a unicode string: If clearly documented,
> I see not too much harm in using a different type scheme than C
> gettext; this should be acceptable in a reimplementation in another
> language.
Torsten, I agree. Let's just rename ugettext() to gettext() and have
it return unicodes. That's the cleanest API we can do for Python.
- -Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
iQCVAwUBSBoWv3EjvBPtnXfVAQJF1QQAr2G+UHqXkuckx9oREYpwsXhDhISy4pKJ
l3Ai+p+vlVsKIPiYn8HSuJYFRa8QIOBT5EOl6DEDMvQ78hYXu1VaLGWO5bOvnrjS
TtCeyM9xZuXWxB3StHO3ao8pK4VdBtljBsi+3vZ8br+4zZpOKQRwiMoWozqyq6u1
EwxFUwE19qI=
=936h
-----END PGP SIGNATURE-----
More information about the Python-3000
mailing list