sorted_robust
(function from pyomo.common.sorting)
- pyomo.common.sorting.sorted_robust(iterable, key=None, reverse=False)[source]
Utility to sort an arbitrary iterable.
This returns the sorted(arg) in a consistent order by first trying the standard sort() function, and if that fails (for example with mixed-type Sets in Python3), use the _robust_sort_keyfcn utility (above) to generate sortable keys.