introduced six as well as using the python3 version of sorted() which no longer takes a cmp function
dealing with itemsview