This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients bbernard, rhettinger
Date 2020-02-05.04:18:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580876313.01.0.705734513446.issue39554@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-02-05 04:18:33rhettingersetrecipients: + rhettinger, bbernard
2020-02-05 04:18:33rhettingersetmessageid: <1580876313.01.0.705734513446.issue39554@roundup.psfhosted.org>
2020-02-05 04:18:32rhettingerlinkissue39554 messages
2020-02-05 04:18:32rhettingercreate