method gets overwritten?!

Alex Martelli aleax at
Fri Mar 14 15:50:13 CET 2003

Alexander Skwar wrote:
> Uhm, why do I get this error?  Why is _ overwritten with a string?  _ got

The interactive interpreter uses name _ in the __builtins__ module to store
the last non-None result from an expression-statement.  You can change this
behavior by assigning sys.displayhook to your callable that does whatever
you prefer with all results from expression-statements typed at the
interactive interpreter prompt, rather than displaying and binding to name
__builtins__._ such results as the default sys.displayhook does.


More information about the Python-list mailing list