-
-
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] rich.inspect() does not appear to honor the "sort" keyword argument #3432
Comments
Presumably |
It does: Lines 136 to 145 in a060eed
Even if the object defines |
Ahh interesting, look at that, they will always be sorted. So then, what behavior should I expect from the rich.inspect sort keyword argument? |
I suspect in an older version, the output could be unsorted. But it does seem redundant now. Removing the option would be sensible, but that would constitute a breaking change. |
Out of curiosity, I went looking through the old Python docs and it looks like the results of |
Describe the bug
Performing rich.inspect() on a class object with sort=False and sort=True results in the same output for class attributes which are not already naturally in alphabetical order (i.e. both appear sorted alphabetically).
Result:
Result:
Platform
Python 3.11.3
WSL: Ubuntu-22.04
If you're using Rich in a terminal:
If you're using Rich in a Jupyter Notebook, run the following snippet in a cell
and paste the output in your bug report.
The text was updated successfully, but these errors were encountered: