bskinn / sphobjinv

Toolkit for manipulation and inspection of Sphinx objects.inv files
https://sphobjinv.readthedocs.io
MIT License
78 stars 9 forks source link

Improve `Inventory.__repr__` (and `DataObjXyz.__repr__`?) completeness #203

Open bskinn opened 3 years ago

bskinn commented 3 years ago

Is your feature request related to a problem? Please describe. Per the Python docs, if possible __repr__() should provide a representation that can be used to recreate the object. Right now, I'm pretty sure it doesn't do this for either Inventory or the SuperDataObj subtypes.

Describe the solution you'd like Revise the __repr__ output suitably. Instantiation of each type is probably straightforward enough that this would be feasible, and relatively readable.

A __repr__ for Inventory with all object details is obviously not feasible, due to the massive output it would generate. Thus, SourceType.Manual instances, as well as those created directly from strings, would just not have a recreation-usable __repr__. It should be possible with the other source types.... though the Inventory data model might have to be revised in order to store the source location (file path or URL).

Describe alternatives you've considered N/A

Additional context N/A