[issue18217] Deprecate and remove gettext.install

2013-06-14 Thread Alex Gaynor
New submission from Alex Gaynor: There's a myriad of reasons it's a bad idea: * Makes code harder to read * Doesn't play nicely with multiple projects using gettext * Defeats any attempt at static analysis * etc... -- messages: 191152 nosy: alex priority: normal severity: normal status:

[issue18217] Deprecate and remove gettext.install

2013-06-14 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue18217] Deprecate and remove gettext.install

2013-06-14 Thread R. David Murray
R. David Murray added the comment: How would you do dynamic switching of translation locale at runtime, then? -- nosy: +r.david.murray ___ Python tracker ___

[issue18217] Deprecate and remove gettext.install

2013-06-14 Thread Alex Gaynor
Alex Gaynor added the comment: I'm not sure I understand the question. What `install()` does is set `__builtins__._` to be gettext. I think people should import the gettext function they need. -- ___ Python tracker

[issue18217] Deprecate and remove gettext.install

2013-06-14 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jun 14, 2013, at 09:27 PM, R. David Murray wrote: >How would you do dynamic switching of translation locale at runtime, then? flufl.i18n :) http://pythonhosted.org/flufl.i18n/ -- ___ Python tracker

[issue18217] Deprecate and remove gettext.install

2013-06-14 Thread R. David Murray
R. David Murray added the comment: install says this: This installs the function _() in Python’s builtins namespace, based on domain, localedir, and codeset which are passed to the function translation() Unless I'm misunderstanding something, this means that the actual value of _ is diffe

[issue18217] Deprecate and remove gettext.install

2013-06-14 Thread Alex Gaynor
Alex Gaynor added the comment: I think the code makes what this does much clearer: http://hg.python.org/cpython/file/01da7bf11ca1/Lib/gettext.py#l209 There's no reason you can't make your own translation object, and expose it's gettext method as as your API, and then you can update the underly

[issue18217] Deprecate and remove gettext.install

2013-06-14 Thread R. David Murray
R. David Murray added the comment: Which is what Barry's library does. But rather than just deprecating install, I think we should fix the module so that it supports this directly. That could be as simple as adding a dynamic translations class. What does library code that wants to provide in

[issue18217] Deprecate and remove gettext.install

2013-06-21 Thread Éric Araujo
Éric Araujo added the comment: Working with an explicit translator object sounds much better to me too. I haven’t used it yet, but Babel has been on my radar for long, and does that (like flufl.i18n from what I can tell). -- nosy: +eric.araujo ___

[issue18217] Deprecate and remove gettext.install

2013-06-21 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jun 21, 2013, at 04:18 PM, Éric Araujo wrote: >Working with an explicit translator object sounds much better to me too. I >haven’t used it yet, but Babel has been on my radar for long, and does that >(like flufl.i18n from what I can tell). flufl.enum didn'

[issue18217] Deprecate and remove gettext.install

2013-06-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: The rationale for install is "For convenience, you want the _() function to be installed in Python’s builtins namespace, so it is easily accessible in all modules of your application." As David noted, this also make it easy to update _ in just one place when a

[issue18217] Deprecate and remove gettext.install

2013-06-27 Thread Jakub Wilk
Changes by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/