>
> It would not be nice if the traceback module API started providing
> text with embedded escape sequences without a way to turn then off in the
> API.
>

I think fobj.isatty() would give the traceback module a good idea whether
it's writing to a display device or not. There are a number of other
complications though (APIs, platform differences, TERM environment
variables or lack thereof, forcible overriding through an API, what other
systems (IDLE, PyCharm, etc) do, ...). If it seems the right place to make
a change is in the traceback module, my recommendation would be to fork the
existing module and publish your prototype on PyPI. Here's a PyPI module
(last updated several years ago) that purports to color traceback output:

https://pypi.org/project/colored-traceback/

(This really belongs on python-ideas, right?)

Skip

>
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/AIOGXKOTAV6WGGQ6JHOBF4U4Q6S3RRRK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to