Message361405
I understand the confusion, but this isn't a bug.
Specifying "typed=True" means that the cache is required to treat the calls f(1) and f(1.0) as distinct.
However, specifying or defaulting to "typed=False" means that the cache isn't required to do so, but it is still allowed to.
This flexibility allowed the tool to add a space saving path for *int*. It comes at the expense of leaving equivalent int/float calls as distinct. Most apps win here because it is typical to keep the type the same across calls. Also, the saved space may allow users to choose a larger value for *maxsize*.
Note, similar liberties were taken with keyword argument ordering. Formerly, f(a=1, b=2) was considered equivalent to f(b=1, a=1). Now, they are treated as distinct. The downside is a potential extra call. The upside is that we save the huge overhead of sorting the keyword arguments. Mostly, this is a net win, despite the visible change in cache utilization statistics. |
|
Date |
User |
Action |
Args |
2020-02-05 04:18:33 | rhettinger | set | recipients:
+ rhettinger, bbernard |
2020-02-05 04:18:33 | rhettinger | set | messageid: <1580876313.01.0.705734513446.issue39554@roundup.psfhosted.org> |
2020-02-05 04:18:32 | rhettinger | link | issue39554 messages |
2020-02-05 04:18:32 | rhettinger | create | |
|