la
la copied to clipboard
larry.fromlist doesnt keep order
I have noticed that when i convert larry into list and convert it back to larry using fromlist function, larry loses order if i have some custom ordering. It looks like this is due to set function in list2index. Would it be possible to introduce a keep_order optional parameter in list2index to use another function instead of set to uniqify list? Looks like something like f5 on http://www.peterbe.com/plog/uniqifiers-benchmark would do the trick.
If you store larrys in hdf5 then the label order is preserved across save and loads. Can you use hdf5 in your use case?
I am storing data as json at some point so lists work better for me. I have actually made the changes on my local copy but i would rather not diverge too much
Sounds like a reasonable feature to add. So we'd add a sort_label (True by default) to fromlist and fromtuples. Plus update docstrings, manual, and add unit tests.
Are you interested in making a pull request with those changes?
Sure, haven't made a pull request before so it will be nice to learn how to make these
Take your time, I won't be able to look at it for the next couple of weeks.