sphobjinv icon indicating copy to clipboard operation
sphobjinv copied to clipboard

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

Open bskinn opened this issue 3 years ago • 0 comments

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

bskinn avatar Jul 01 '21 10:07 bskinn