Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could it be worthy to make VerboseTB._tb_highlight_style a public attribute? #14464

Closed
dalthviz opened this issue Jun 19, 2024 · 1 comment
Closed

Comments

@dalthviz
Copy link
Contributor

Hi! Over QtConsole we are doing some work to use the changes done at #14138 to customize traceback syntax highlighting (see jupyter/qtconsole#608).

Following jupyter/qtconsole#608 (comment) and jupyter/qtconsole#608 (comment), wanted to check if making VerboseTB._tb_highlight_style a public attribute makes sense/could be possible.

Also, are there any plans related with changing the traceback syntax highlighting logic in the future? Any in info is greatly appreciated!

@Carreau
Copy link
Member

Carreau commented Jun 20, 2024

I think I would be ok to make it public, but in general it would be good to rethink some of the ultratb code, it could take the style as a configuration option in the constructor, and could use a lot of new CPython new features like actually use annotations, and also implement the "did you mean" when there are typoes.

In general it is also emitting directly ascii code; in a perfect world I'd like to return more structered data at at least a number of token, style pairs so that rendering could be better handled on a per-frontend basis.

Even in html we could make use of hover to see variable values; or collapse frames.

But all that needs time, and I barely have a few hours a month on IPython, so no no short term plan to change.

If you send a PR that make this value public (with I guess a property to warn of deprecation of the private attribute I'm happy to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants