sphobjinv
sphobjinv copied to clipboard
Implement __getitem__ to index into .objects
More Pythonic. Starting with just getitem as it's straightforward to implement and the other list functions would only be useful in advanced editing/creation scenarios.
OTOH, POLA would indicate implementing none or all...
ONLY IMPLEMENT in combo with #43!
Numeric key/index seems straightforward.
A more mapping-like interface, say where one can pass the name to be found, would also have been useful here. A catch with this is that names aren't guaranteed to be unique within the inventory. Would have to address this somehow.