[Python-Dev] At the interactive port

Ka-Ping Yee ping@lfw.org
Tue, 2 May 2000 02:46:40 -0700 (PDT)

On Tue, 2 May 2000, Moshe Zadka wrote:
> > Thanks for bringing this up again.  I think it should be called
> > sys.displayhook.

I apologize profusely for dropping the ball on this.  I
was going to do it; i have been having a tough time lately
figuring out a Big Life Decision.  (Hate those BLDs.)

I was partway through hacking the patch and didn't get back
to it, but i wanted to at least air the plan i had in mind.
I hope you'll allow me this indulgence.

I was planning to submit a patch that adds the built-in routines



sys.display(obj) would be implemented as 'print repr(obj)'
and sys.displaytb(tb, exc) would call the same built-in
traceback printer we all know and love.

I assumed that sys.__stdin__ was added to make it easier to
restore sys.stdin to its original value.  In the same vein,
sys.__display__ and sys.__displaytb__ would be saved references
to the original sys.display and sys.displaytb.

I hate to contradict Guido, but i'll gently suggest why i
like "display" better than "displayhook": "display" is a verb,
and i prefer function names to be verbs rather than nouns
describing what the functions are (e.g. "read" rather than
"reader", etc.)

-- ?!ng