LettError/MutatorMath

Python 3 won't sort lists of dictionaries

Closed this issue · 5 comments

A few places around this line, lists of dictionaries are sorted:

...but Python 3 doesn't do this any more. I'm trying to figure out how important the sorting is here to the rest of the functionality, or which key it should be sorted on, so I thought I'd open an issue for now.

Did you hit a TypeError?

Location objects are subclasses of dict that implement the comparison methods, so they are designed to be sorteable

Ah, interesting! In that case my problem might be one step higher, there's a TypeError when using the DesignSpaceEditor extension in RoboFont:

.../mutatorMath/objects/location.py", line 652, in biasFromLocations
TypeError: '<' not supported between instances of 'collections.OrderedDict' and 'collections.OrderedDict'

...so maybe the extension isn't preparing the location objects properly. I can look further into it over there if you don't think it's a problem in MutatorMath.

Please consider moving to UFOProcessor for generating UFOs out of designspaces.

This should be fixed with this change.