Description

We install a function called _() as an alias for gettext() into __builtins__ so that we don't have to import everywhere we want to translate strings.

The Python interactive shell uses the _ variable to store the most recent result. Any doctests run in the same sort of environment as the interactive shell and so this variable gets nuked. If a class has doctests and uses translation functionality, chaos ensues.

One solution is to import gettext() and alias it to _() in each modules' scope. A little awkward but not inherently bad. Maybe there's another solution I haven't thought of yet, though.