alvinwan / TexSoup

fault-tolerant Python3 package for searching, navigating, and modifying LaTeX documents
https://texsoup.alvinwan.com
BSD 2-Clause "Simplified" License
290 stars 43 forks source link

Improve repr of several objects #154

Open user202729 opened 8 months ago

user202729 commented 8 months ago

Reasoning: this new representation allows viewing how to access the parts of the object easier.

Mostly, it is designed such that only the top level detail is shown. So that there is not too much detail to clutter the screen, and if the user wants to navigate inside the object, it is possible to simply access the corresponding method/item.

In my opinion, the only part where I replace constructible repr with non-constructible repr is at TexGroup, but I don't see a good way around that. (We can also revert to the original behavior.)

I find this feature mostly useful when the objects are created and manipulated in an interactive shell --- then the user can visually see what are the properties of the current object.


What do you think about the idea? If it sounds reasonable I will implement the tests.