Commit 9f2ea357 authored by Ben Mabey's avatar Ben Mabey Committed by drpngx
Browse files

coerce dict keys to strings when sorting for python3 compat (#11039)

In python 2 you can sort dicts with hetroeneous types:

   In [1]: d = {"z": 1, 1: 42, ("a", "b"): 100}
   In [2]: sorted(d)
   Out[2]: [1, 'z', ('a', 'b')]

In python 3 you get an error:

   In [1]: d = {"z": 1, 1: 42, ("a", "b"): 100}
   In [2]: sorted(d)
   ---------------------------------------------------------------------------
   TypeError                                 Traceback (most recent call last)
   <ipython-input-5-01813638448d> in <module>()
   ----> 1 sorted(d)
parent 7c689a2f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment