Lets say my key is not a simple data type but a class, and I need to sort the keys by using a comparison function. In Scala, I can do this by using, `new Ordering`. How can I achieve the same functionality in Python? For example, what would be the equivalent code in Python?

```
implicit val someClassOrdering = new Ordering[SomeClass] {
        override def compare(a: SomeClass, b: SomeClass) = a.compare(b)
    }

```