COMPAT: Pypy tweaks
a set of tweaks that I discovered when getting PyPY to pass tests, some could cause issues on CPython as well:

- 496cc3a clears up an assumption that sets are sorted
- d161b08 makes sure PyList_GET_SIZE is used only on PyListObject, if used on an ndarray it will return the value of the data pointer, which is not the intention at all
- 2744c5c separates the cases where ``float('nan') is not np.nan`` and like cases by implementation, on PyPy the ``is`` comparison always checks the value of struct.pack('d', val) for equality.
- 5425137 cleans up the use of ``rank`` and ``mean`` as keys (the warnings are ignored?) and adds a trivial assert where a test was simply making a call

I left these as seperate commits for ease of discussion and possible rejection, if desired I can squash them to a single commit
