-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[BUG] inconsistent coloring of complex numbers #2214
Comments
Rich doesn't have any explicit supports for complex numbers. If you're adept with regexes, you could add it to highlighter.py |
Thanks will, I'll try that. However, respectfully, complex numbers are natively supported by python so in my opinion they should also be natively supported by the rich pretty printer. Having to specify the same regex over and over in interactive sessions (which many scientific exploratory notebooks are for example) is not really user friendly... Like I said, it's a very minor issue and I understand that adding this feature might yield unnecessary overhead on your side. If that's the case just disregard it, but I think as rich will become more popular in the scientific community you might get this question again. |
I was actually suggesting that you could contribute this to highlighter.py in the repo, if you could come up with the regex. I'm happy to add it. |
Sure! I'll give it a shot 🙂 |
Ai, lost my opportunity to contribute to this awesome library 😉. Thanks a lot for this quick resolution! |
Did I solve your problem? Why not buy the devs a coffee to say thanks? |
Not sure if I should report this as a bug or as a feature request, but there is a very minor issue when printing complex numbers: the decimal part of the imaginary number is uncolored.
try for example:
I tried this on Linux, rich version 12.2.0. This "bug" appears both in the terminal (alacritty in my case) as well as in jupyter notebooks, which makes me believe it is platform independent.
The text was updated successfully, but these errors were encountered: