﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2920	Putting _() into builtins causes trouble with doctests	Malcolm Tredinnick	nobody	"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.

Original problem description in [http://groups.google.com/group/django-users/browse_frm/thread/6e03320a69544c72/11c56b7d0dd35b4c#11c56b7d0dd35b4c this django-users thread]."	defect	closed	Testing framework		normal	fixed			Accepted	0	0	0	0	0	0
