You can sort anything you can calculate a key for (or that has an attribute that can be used as a key). Turns out that includes also objects and... functions!