diff --git a/pandas/core/common.py b/pandas/core/common.py index 8b152162dc95a..bb911c0617242 100644 --- a/pandas/core/common.py +++ b/pandas/core/common.py @@ -200,14 +200,6 @@ def count_not_none(*args) -> int: return sum(x is not None for x in args) -def try_sort(iterable): - listed = list(iterable) - try: - return sorted(listed) - except TypeError: - return listed - - def asarray_tuplesafe(values, dtype=None): if not (isinstance(values, (list, tuple)) or hasattr(values, "__array__")): diff --git a/pandas/core/indexes/api.py b/pandas/core/indexes/api.py index 0a23d38ace37e..fcce82e7a69db 100644 --- a/pandas/core/indexes/api.py +++ b/pandas/core/indexes/api.py @@ -256,8 +256,7 @@ def _sanitize_and_check(indexes): if list in kinds: if len(kinds) > 1: indexes = [ - Index(com.try_sort(x)) if not isinstance(x, Index) else x - for x in indexes + Index(list(x)) if not isinstance(x, Index) else x for x in indexes ] kinds.remove(list) else: