[Idle-dev] About extensions ... New: excepthook experiments with IDLE and Friendly-traceback
André Roberge
andre.roberge at gmail.com
Wed Feb 10 13:52:31 EST 2021
Apologies if you receive this message twice. I sent an email a few hours
ago but I have not seen any sign of it in the idle-dev archive. From past
experience, I do not recall messages to idle-dev being moderated, so I
decided to reply to an older message in this second attempt.
= = =
Hello everyone,
The latest Python version (3.10.a5) of IDLE's repl has support for
user-defined exception hooks. After being contacted by Terry Reedy about
this feature, I investigated integrating Friendly-traceback [1] with IDLE.
For those that are interested, I have documented on github [2] (with
screenshots) how Friendly-traceback works with IDLE, including some
limitations. Feel free to comment on that issue for any suggestion you
might have about possible improvements to Friendly-traceback, including the
current API used.
In some cases, I determine based on Python's version whether or not a
feature can be enabled. I consider this to be brittle. Rather than relying
on Python's version, I would much prefer if I could be able to write
something like:
try:
from idlelib import support_excepthook
except:
support_excepthook = False
This would be especially useful if this support for user-defined exception
hooks within IDLE's shell is backported to older versions of Python.
Something similar would also be useful if and when support for custom
handling of SyntaxError is added to IDLE.
Best,
André Roberge
[1] https://aroberge.github.io/friendly-traceback-docs/docs/html/
Currently, the documentation does not include the new IDLE-related features.
[2] https://github.com/aroberge/friendly-traceback/issues/183
>
>
> _______________________________________________
> IDLE-dev mailing list
> IDLE-dev at python.org
> https://mail.python.org/mailman/listinfo/idle-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/idle-dev/attachments/20210210/c0703f22/attachment.html>
More information about the IDLE-dev
mailing list