Author ezio.melotti
Recipients atsuoi, ezio.melotti, giampaolo.rodola, loewis, vstinner
Date 2009-04-01.02:42:00
SpamBayes Score 2.50874e-05
Marked as misclassified No
Message-id <1238553724.68.0.824866155045.issue5110@psf.upfronthosting.co.za>
In-reply-to
Content
In the first message I said that this breaks the PEP3138 because I
thought that the solution was to change the default error-handler to
'backslashreplace', but this was already proposed and refused.

sys.displayhook provides a way to change the behavior of the interactive
interpreter only when ">>> foo" is used. The PEP doesn't seem to say
anything about how ">>> foo" should behave.

Moreover, in the alternate solutions [1] they considered to use
sys.displayhook (and sys.excepthook) but they didn't because "these
hooks are called only when printing the result of evaluating an
expression entered in an interactive Python session, and doesn't work
for the print() function, for non-interactive sessions or for
logging.debug("%r", ...), etc."

This is exactly the behavior I intended to have, and, being a unique
feature of the interactive interpreter, it doesn't lead to inconsistence
with other situations.

[1]: http://www.python.org/dev/peps/pep-3138/#alternate-solutions
History
Date User Action Args
2009-04-01 02:42:05ezio.melottisetrecipients: + ezio.melotti, loewis, atsuoi, vstinner, giampaolo.rodola
2009-04-01 02:42:04ezio.melottisetmessageid: <1238553724.68.0.824866155045.issue5110@psf.upfronthosting.co.za>
2009-04-01 02:42:01ezio.melottilinkissue5110 messages
2009-04-01 02:42:00ezio.melotticreate