-
Notifications
You must be signed in to change notification settings - Fork 13
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
Limit amount of items shown #11
Comments
hi, what your describe is also my concern. when people use if i limit the items, it would happen to hide important ones! but, the children of first level items people may not care about very much. so, what about this idea:
|
Note that I honestly wouldn't be concerned to try multiple runs through all the items, first to find out all the depths, then to print the best way. The reason is that printing itself is already really slow, so people shouldn't use it at critical moments. When people do want speed, you might offer a "fast" mode. More ideas:
Lot's of ideas, but I understand it is difficult. |
Great idea! I like how you truncate long lines. I have a class on which it works really nicely, except that it contains a dictionary with many items. Perhaps you could come up with some smart way to truncate only if there are too many keys to be shown (and then not to display)?
In my case I can say that I consider 185 keys too much to be "beeprinted" :-)
Or perhaps for classes, consider a "depth" variable that perhaps indicates scaling.
You could do this to any kind of depth, e.g. a dict in a list will show fewer entries than if it would just be a list, and perhaps a dict in a dict in a list even fewer :)
The text was updated successfully, but these errors were encountered: