[Python-Dev] PEP 217 - Display Hook for Interactive Use
Guido van Rossum
guido@python.org
Fri, 08 Dec 2000 13:51:49 -0500
Moshe proposes to add an overridable function sys.displayhook(obj)
which will be called by the interpreter for the PRINT_EXPR opcode,
instead of hardcoding the behavior. The default implementation will
of course have the current behavior, but this makes it much simpler to
experiment with alternatives, e.g. using str() instead of repr() (or
to choose between str() and repr() based on the type).
Moshe has asked me to pronounce on this PEP. I've thought about it,
and I'm now all for it. Moshe (or anyone else), please submit a patch
to SF that shows the complete implementation!
--Guido van Rossum (home page: http://www.python.org/~guido/)