Post AQLoAR2exTyJRNzu9A by ok_devalias@hachyderm.io
 (DIR) More posts by ok_devalias@hachyderm.io
 (DIR) Post #AQLoAQQNFpLZWe5KTI by nedbat@hachyderm.io
       2022-12-07T02:26:25Z
       
       0 likes, 0 repeats
       
       JSON only has string keys. What if you want your #python dict to have int keys? Convert them, one of three ways:
       
 (DIR) Post #AQLoAR2exTyJRNzu9A by ok_devalias@hachyderm.io
       2022-12-07T02:34:52Z
       
       0 likes, 0 repeats
       
       @nedbat i keep wondering which is more modern pythonic.  i see 1 and 3 a lot but i think 1 might be most common these days?
       
 (DIR) Post #AQLoARZcyuLL5dQEXA by cnx@larkspur.one
       2022-12-07T03:27:50.355488Z
       
       0 likes, 0 repeats
       
       @ok_devalias, the first one should (allow a Python implementation to) perform the least computation.   Not sure about @nedbat but Guido is not a fan of higher order functions in Python like in the last one, hence dict comprehensions (and reduce being hidden in functools).