Oct. 26, 2020
10:04 a.m.
26.10.20 10:10, Inada Naoki пише:
Of course, there are some runtime costs too.
https://github.com/python/cpython/blob/fb5db7ec58624cab0797b4050735be865d380... https://github.com/python/cpython/blob/fb5db7ec58624cab0797b4050735be865d380... (maybe more, but I'm not sure)
It will not help much in these cases because we still need to distinguish 1 from True and 1.0 and -0.0 from 0.0. But if keys only can be str or bytes, we pay additional cost. An example is the re cache.