Re: Disabling the magic "last expression" _ variable

2008-07-01 Thread Ben Finney
Peter Otten <[EMAIL PROTECTED]> writes: > >>> import sys > >>> def displayhook(result): > ... if result is not None: > ... __builtins__._last = result > ... print result > ... Better is to explicitly import the name '__builtin__' http://www.python.org/doc/lib/module-bu

Re: Disabling the magic "last expression" _ variable

2008-07-01 Thread Peter Otten
Koen Vossen wrote: > A project I'm currently working on uses Turbogears as a framework. I'd > like to interact with it using the tg-admin shell. We also use gettext's > _() function for internationalization. Now, this function is overwritten > in interactive mode, which causes annoying exceptions.

Re: Disabling the magic "last expression" _ variable

2008-07-01 Thread Peter Otten
Koen Vossen wrote: > A project I'm currently working on uses Turbogears as a framework. I'd > like to interact with it using the tg-admin shell. We also use gettext's > _() function for internationalization. Now, this function is overwritten > in interactive mode, which causes annoying exceptions.

Disabling the magic "last expression" _ variable

2008-07-01 Thread Koen Vossen
A project I'm currently working on uses Turbogears as a framework. I'd like to interact with it using the tg-admin shell. We also use gettext's _() function for internationalization. Now, this function is overwritten in interactive mode, which causes annoying exceptions. Is it possible to disab